mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
When checking for the wrong routing method, ensure the environment is passed to recognize optimize [#1406 state:resolved]
This commit is contained in:
@@ -56,7 +56,7 @@ module ActionController
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user