When checking for the wrong routing method, ensure the environment is passed to recognize optimize [#1406 state:resolved]

This commit is contained in:
Joshua Peek 2008-12-17 10:20:19 -06:00
parent 175cb7a963
commit f23c2796ee

@ -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)