Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#1406
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...

Reported by Evgeniy Pirogov · November 18th, 2008 @ 07:25 PM

State: resolved
Milestone: 2.x
Assigned to: josh josh
Importance: none

Activity

  1. josh
    josh
    • Assigned user set to josh
    • State changed from new to open

    December 15th, 2008 @ 09:35 PM

  2. Repository
    Repository
    • 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...

    December 17th, 2008 @ 04:22 PM