提交 f23c2796 编写于 作者: J Joshua Peek

When checking for the wrong routing method, ensure the environment is passed...

When checking for the wrong routing method, ensure the environment is passed to recognize optimize [#1406 state:resolved]
上级 175cb7a9
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册