diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-11 00:01:22 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-11 00:01:22 -0600 |
commit | 588225f8852c4b60bfba38f16d8797a41e175400 (patch) | |
tree | e3272d8c2e196b5ac89ab2ccd465cebf521b16d6 /actionpack/lib/action_dispatch/routing | |
parent | 2f90d700498294a9a4da0baa5317c0e6feaaf176 (diff) | |
download | rails-588225f8852c4b60bfba38f16d8797a41e175400.tar.gz rails-588225f8852c4b60bfba38f16d8797a41e175400.tar.bz2 rails-588225f8852c4b60bfba38f16d8797a41e175400.zip |
Remove fancy method not allowed resource exceptions since they are
too much of a hack
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 8d56c4d087..d71ed1d1db 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -456,30 +456,9 @@ module ActionDispatch def call(env) @set.call(env) - rescue ActionController::RoutingError => e - raise e if env['action_controller.rescue_error'] == false - - method, path = env['REQUEST_METHOD'].downcase.to_sym, env['PATH_INFO'] - - # Route was not recognized. Try to find out why (maybe wrong verb). - allows = HTTP_METHODS.select { |verb| - begin - recognize_path(path, {:method => verb}, false) - rescue ActionController::RoutingError - nil - end - } - - if !HTTP_METHODS.include?(method) - raise ActionController::NotImplemented.new(*allows) - elsif !allows.empty? - raise ActionController::MethodNotAllowed.new(*allows) - else - raise e - end end - def recognize_path(path, environment = {}, rescue_error = true) + def recognize_path(path, environment = {}) method = (environment[:method] || "GET").to_s.upcase begin @@ -489,7 +468,6 @@ module ActionDispatch end env['action_controller.recognize'] = true - env['action_controller.rescue_error'] = rescue_error status, headers, body = call(env) body end |