Commit Graph

61 Commits

Author SHA1 Message Date
David Heinemeier Hansson
f42c77f927 Added ActiveSupport::BacktraceCleaner and Rails::BacktraceCleaner for cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH] 2008-11-22 18:06:08 +01:00
Pratik Naik
259a7a844b Add tests for ActiveSupport::Rescuable. Use ActiveSupport::Rescuable in ActionController::Base. 2008-10-04 22:13:50 +01:00
Pratik Naik
5e3517ea7b Ensure rescue_from handlers are respected inside tests. [#835 state:resolved]
Note : If you're not using rescue_from, you should overrider rescue_action_without_handler() method
and not rescue_action(). Afterwards, you can set request.remote_addr to a non "0.0.0.0" value for testing the
overridden behavior.
2008-10-04 18:43:46 +01:00
Pratik Naik
6ef35461dc Merge docrails 2008-09-03 17:58:47 +01:00
Pratik Naik
a59a3db1f3 Move copying ivar logic from ActionController::Base to ActionView::Base 2008-08-31 03:48:09 +01:00
Ryan Bates
1129a24caf Cleanup around partial rendering
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-08-21 21:03:33 -05:00
Pratik Naik
90c930f45c Allow Dispatcher exceptions to be handled in application.rb using rescue_from 2008-07-16 18:54:08 +01:00
Joshua Peek
ad772402c4 Made ActionView::Base#render_file private 2008-06-25 05:57:24 -05:00
Jeremy Kemper
cde6a259bf Simpler rescue_action condition 2008-05-12 13:24:32 -07:00
Xavier Noria
64092de257 Improve documentation coverage and markup
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-02 14:45:23 +01:00
David Heinemeier Hansson
162c7c1908 Changing "and" to && whereever I catch it 2008-04-27 17:15:50 -05:00
Pratik Naik
ef4c65088f Move missing template logic to ActionView 2008-04-19 18:59:13 +01:00
David Heinemeier Hansson
420c4b3d88 Added Rails.public_path to control where HTML and assets are expected to be loaded from (defaults to Rails.root + "/public") #11581 [nicksieger] 2008-04-13 17:33:27 -05:00
Jeremy Kemper
b1ce7e4d4a Ruby 1.9 compat: File.exists\? -> File.exist\? en masse. References #1689 [Pratik Naik]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 05:54:46 +00:00
David Heinemeier Hansson
2af36bbbd4 Fix typos (closes #10378)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 18:54:41 +00:00
David Heinemeier Hansson
713ca5196d Docfix (closes #10155)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8165 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-18 21:51:09 +00:00
Michael Koziarski
788ece4799 Make rescue_from behave like rescue when dealing with subclasses. Closes #10079 [fxn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8081 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 06:02:24 +00:00
Jeremy Kemper
4db4661a67 rescue_from accepts :with => lambda { |exception| ... } or a normal block. Closes #9827.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7822 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 02:34:42 +00:00
Jeremy Kemper
0ee1cb2cd3 Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
bdf5672077 Change from InvalidToken to InvalidAuthenticityToken to be more specific
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 23:12:25 +00:00
Jeremy Kemper
dfcb5af2dc Move rescue_action_with_handler from rescue_action to perform_action so it isn't clobbered by test overrides. References #9449, closes #9645.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-24 19:56:11 +00:00
Jeremy Kemper
a6f49d9b78 Introduce ActionController::Base.rescue_from to declare exception-handling methods. Cleaner style than the case-heavy rescue_action_in_public. Closes #9449.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:56:22 +00:00
Rick Olson
4e3ed5bc44 Merge csrf_killer plugin into rails. Adds RequestForgeryProtection model that verifies session-specific _tokens for non-GET requests. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7592 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 02:32:55 +00:00
David Heinemeier Hansson
ff9ca2ca1e Random hits from the style nazi
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7438 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 23:12:57 +00:00
Michael Koziarski
f81dae3fca Remove deprecated functionality from actionpack. Closes #8958 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-03 00:18:30 +00:00
Jeremy Kemper
dcaa074abf Routing: respond with 405 Method Not Allowed status when the route path matches but the HTTP method does not. Closes #6953.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 20:07:34 +00:00
David Heinemeier Hansson
70ac560e42 Removed breakpointer and Binding.of_caller in favor of relying on ruby-debug by Kent Sibilev since the breakpointer has been broken since Ruby 1.8.4 and will not be coming back [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6611 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-28 15:57:29 +00:00
David Heinemeier Hansson
e105653066 Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 22:09:12 +00:00
Jeremy Kemper
d38417fc02 RecordInvalid, RecordNotSaved => 422 Unprocessable Entity, StaleObjectError => 409 Conflict. References #7097.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5966 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-17 00:43:53 +00:00
Michael Koziarski
67194d9c2d Improve the documentation for customising your rescue actions. Closes #7041 [rsanheim]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 07:17:58 +00:00
Jeremy Kemper
a1ca37ec86 Use 400 Bad Request status for unrescued ActiveRecord::RecordInvalid exceptions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-22 00:27:39 +00:00
Jeremy Kemper
9a27b29755 Silence log_error deprecation warnings from inspecting deprecated instance variables.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 23:16:10 +00:00
Jeremy Kemper
a454dcf012 Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-08 22:19:00 +00:00
Jeremy Kemper
f0753992ab test controller rescues
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 02:03:50 +00:00
David Heinemeier Hansson
31d3048706 Fixed that rescue template path shouldn't be hardcoded, then it's easier to hook in your own (closes #6295) [mnaberez]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5243 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 00:40:05 +00:00
Rick Olson
3010e30f0e Fixed some deprecation warnings in ActionPack [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-30 01:38:22 +00:00
David Heinemeier Hansson
2caf4d5a93 Added proper getters and setters for content type and charset [DHH] Added utf-8 as the default charset for all renders. You can change this default using ActionController::Base.default_charset=(encoding) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-17 16:20:32 +00:00
David Heinemeier Hansson
3558322b9d Changed that uncaught exceptions raised any where in the application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static "Application error (Rails)" [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4955 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-03 23:51:34 +00:00
Jeremy Kemper
12ff554cd4 Tighten rescue clauses. Closes #5985.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-31 03:16:28 +00:00
Jeremy Kemper
c40b1a4a67 Deprecate direct usage of @params. Update ActionView::Base for instance var deprecation.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4715 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-07 12:40:14 +00:00
Marcel Molina
9f92dd3984 Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 20:20:22 +00:00
Marcel Molina
6186490962 Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 18:10:14 +00:00
David Heinemeier Hansson
f7359342af Added protection against proxy setups treating requests as local even when they're not #3898 [stephen_purcell@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3892 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 03:31:40 +00:00
David Heinemeier Hansson
82f1e19e4c Fixed docs (closes #2468)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2749 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-26 13:20:46 +00:00
David Heinemeier Hansson
0ea1375d75 Really fix the syntax error issue
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1952 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-28 17:41:19 +00:00
David Heinemeier Hansson
9fad3251d3 More fixes, but still broken
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1948 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-27 14:17:47 +00:00
David Heinemeier Hansson
5b52b716b7 Fixing the fix, but not quite
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-27 13:55:39 +00:00
David Heinemeier Hansson
36fee9c02e Fixed broken error handling #1827 [Stefan Kaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-25 09:39:57 +00:00
Nicholas Seckar
fe0c7f4f76 Fix rescue handling to erase both render and redirect results
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-14 00:34:27 +00:00
David Heinemeier Hansson
dab360e181 Added DoubleRenderError exception that'll be raised if render* is called twice #518 [Nicholas Seckar]. Fixed exceptions occuring after render has been called #1096 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-21 18:51:08 +00:00