Reputation: 1896
match '/:question_id', :to => 'welcome#dashboard', :via => [:get], constraint: { question_id: /\d+/ }
I don't know why this routing rule is matching paths like
localhost/assets
because I added the numeric constraint to only matching digits.
Upvotes: 0
Views: 185
Reputation: 6682
The option is contstraints
.
match '/:question_id', :to => 'welcome#dashboard', :via => [:get], constraints: { question_id: /\d+/ }
Upvotes: 1