This project is archived and is in readonly mode.
Only get, head, post, put, and delete requests are allowed. Route was not recognized. Try to find out why (maybe wrong verb). do not pass all relevant information to route.recognize as it does to recognize_optimized
Reported by Evgeniy Pirogov | November 18th, 2008 @ 07:25 PM | in 2.x
class RouteSet
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, environment.merge(:method => verb)) } }
if environment[:method] && !HTTP_METHODS.include?(environment[:method])
raise NotImplemented.new(*allows)
elsif !allows.empty?
raise MethodNotAllowed.new(*allows)
else
raise RoutingError, "No route matches #{path.inspect} with #{environment.inspect}"
end
end
line
allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, :method => verb) } }
should read
allows = HTTP_METHODS.select { |verb| routes.find { |r| r.recognize(path, environment.merge(:method => verb)) } }
this way environment passed to routes rules
otherwise hostname_routing stop working as there is no information passed to check hostname http://weblog.jamisbuck.org/2006...
Comments and changes to this ticket
-
josh December 15th, 2008 @ 09:35 PM
- Assigned user set to josh
- State changed from new to open
-
Repository December 17th, 2008 @ 04:22 PM
- State changed from open to resolved
(from [f23c2796ee4a217d48bcefbc0056aaab6b1b64fa]) When checking for the wrong routing method, ensure the environment is passed to recognize optimize [#1406 state:resolved] http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1406 Only get, head, post, put, and delete requests are allowed. Route was not recognized. Try to find out why (maybe wrong verb). do not pass all relevant information to route.recognize as it does to recognize_optimized (from [f23c2796ee4a217d48bcefbc0056aaab6b1b64fa]) When ch...