Skip to content
Browse files

When checking for the wrong routing method, ensure the environment is…

… passed to recognize optimize [#1406 state:resolved]
  • Loading branch information...
1 parent 175cb7a commit f23c2796ee4a217d48bcefbc0056aaab6b1b64fa @josh josh committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/routing/recognition_optimisation.rb
View
2 actionpack/lib/action_controller/routing/recognition_optimisation.rb
@@ -56,7 +56,7 @@ def recognize_path(path, environment={})
result = recognize_optimized(path, environment) and return result
# Route was not recognized. Try to find out why (maybe wrong verb).
- allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, :method => verb) } }
+ allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, environment.merge(:method => verb)) } }
if environment[:method] && !HTTP_METHODS.include?(environment[:method])
raise NotImplemented.new(*allows)

0 comments on commit f23c279

Please sign in to comment.
Something went wrong with that request. Please try again.