public Method

RouteSet.recognize_path(path, environment={})

There's no documentation for this item.

Source Code

# File action_controller/routing/recognition_optimisation.rb, line 56
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) } }

  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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.