Commit Graph

57 Commits

Author SHA1 Message Date
Francesco Rodriguez
5fb94ec044 use _action instead of _filter callbacks 2012-12-07 15:24:56 -05:00
Francesco Rodriguez
a53a7bea80 update documentation and code to use _action callbacks 2012-12-07 14:46:06 -05:00
Jose and Yehuda
56cdc81c08 Remove default match without specified method
In the current router DSL, using the +match+ DSL
method will match all verbs for the path to the
specified endpoint.

In the vast majority of cases, people are
currently using +match+ when they actually mean
+get+. This introduces security implications.

This commit disallows calling +match+ without
an HTTP verb constraint by default. To explicitly
match all verbs, this commit also adds a
:via => :all option to +match+.

Closes #5964
2012-04-24 22:52:26 -05:00
Rafael Mendonça França
4b85acba43 Remove unused test code.
ActionController::RoutingError are raised in router execution time and can not be
rescued in a controller.
2012-04-16 23:38:31 -03:00
brainopia
73709f7ffa Removed unused assigns from ActionView::Template::Error
They existed since initial rails commit by DHH but lost use a long time
ago
2012-01-20 20:13:29 +04:00
José Valim
58f69ba085 Remove Rescue middleware that was never used by Rails. 2011-12-24 11:28:05 +01:00
Aaron Patterson
ffbcb84c21 removing more duplicate code 2010-10-01 18:05:59 -07:00
Emilio Tagua
d5bb640eb0 Remove methods to avoid warnings. 2010-09-28 18:40:38 -03:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Piotr Sarnacki
b3eb26a161 Removed deprecated RouteSet API, still many tests fail 2010-09-05 13:44:36 +02:00
José Valim
599e46bf24 Revert "Setup explicit requires for files with exceptions. Removed them from autoloading."
Booting a new Rails application does not work after this commit [#5359 state:open]

This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
2010-09-02 21:11:03 +02:00
Łukasz Strzałkowski
38a421b34d Setup explicit requires for files with exceptions. Removed them from autoloading.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 11:54:04 +02:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Neeraj Singh
33c5689e2d Exceptions from views should be rescued based on the original exception. If a handler for original exception is missing then apply ActiveView::TemplateError
[#2034 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-19 14:50:38 +02:00
Carl Lerche
6c280f3398 RouteSet does not raise ActionController::RoutingError when no routes match anymore. Instead, it follows the X-Cascade convention. ShowExceptions checks for X-Cascade so that the routing error page can still be displayed. 2010-04-30 16:40:42 -07:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
Jeremy Kemper
425a02cece Ruby 1.9: resolve constant lookup issues 2009-11-04 15:41:50 -08:00
Joshua Peek
a5c82a9dfb Start rewriting some internal tests to use the new routing dsl 2009-10-20 16:03:55 -05:00
Yehuda Katz
c44d560145 Rack responses need to wrap Strings in 1.9 2009-10-15 16:37:27 -07:00
Joshua Peek
84e94551f6 Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
2009-10-03 20:45:49 -05:00
Joshua Peek
acfeec5151 Allow integration test rack app to be set with "@app" ivar instead of using open_session 2009-09-26 20:51:05 -05:00
Joshua Peek
52aeb8d2e7 Beef up AD::Rescue to replace global exception handling lost in ApplicationController 2009-09-15 16:33:15 -05:00
Joshua Peek
90d7ae23c6 Remove global exception catching from ApplicationController.
It was severely broken since it was ported to NewBase and is causing problems with normal exception catching. A replacement is coming soon.
2009-09-15 10:05:46 -05:00
Joshua Peek
a3fcfd819b Need to reset session for AP rescue tests after altering the route set 2009-09-13 17:52:33 -05:00
Joshua Peek
8118fca9be Merge Failsafe middleware into ShowExceptions 2009-05-17 12:24:59 -05:00
Joshua Peek
11af089cee Extract ActionController rescue templates into Rescue and ShowExceptions middleware.
This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
2009-05-02 23:02:22 -05:00
Joshua Peek
380431e4ed Fix test_rescue_routing_exceptions when running with rake 2009-04-21 21:11:23 -05:00
Joshua Peek
0b92bb97c1 refactor some coupled rescue tests 2009-04-21 20:41:31 -05:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
Yehuda Katz and Carl Lerche
6c05b5e938 Temporarily modifies setup to call super directly. This can support more T::U runners. 2009-04-08 17:33:41 -07:00
José Valim
24f2e676f7 Added support to dashed locales in templates localization [#1888 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-06 23:23:50 -06:00
Jeremy Kemper
278186534c Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. 2009-02-03 18:40:22 -08:00
José Valim
2ecc678ed6 Added localized rescue (404.da.html) [#1835 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-02 17:56:22 +01:00
Joshua Peek
319ae4628f Move HTTP libs and middleware into ActionDispatch component 2009-01-27 18:54:01 -06:00
Joshua Peek
f00e86d7e9 Memoize request accessors on the Rack env so other request objects have access to the same cache [#1668 state:resolved] 2009-01-04 12:15:15 -06:00
Laszlo Bacsi
606176a55b Fixed call_with_exception for Routing Errors [#1684 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-02 10:46:48 -06:00
Jeremy Kemper
2e1132fad8 Test that exceptions raised in filters are properly rescued 2008-12-30 18:06:56 -08:00
Joshua Peek
5d89605c11 Make router and controller classes better rack citizens 2008-12-28 15:31:03 -06:00
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
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
90c930f45c Allow Dispatcher exceptions to be handled in application.rb using rescue_from 2008-07-16 18:54:08 +01: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
9d755f1983 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +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
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
Michael Koziarski
d4d4a08f6b Make sure missing template exceptions actually say which template they were looking for. Closes #8683 [dasil003]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-11 23:32:02 +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