I have two paths in my routes, the same path pointing to a different controller and action
match '/:id' => 'users#show', :as => 'user', :constraints => UserConstraint match '/:id' => 'customers#show', :as => 'customer'
Does my restriction class have the following matches? Method
def self.matches?(request) return User.exists?(request.path_parameters[:id]) end
this works fine when I call the urls in my browser. however, this does not work for the detect_path method.
Rails.application.routes.recognize_path("/trump", {:method => :get})
returns a routing error (no route matches), while it works when called in the browser, since it is routed accordingly.
there is a user with: id => trump.
How do I get the parameter_recognition method to return path information?
ruby ruby-on-rails ruby-on-rails-3
raphael maicheal
source share