Multiple parameters to named route rails 3
-
05-06-2021 - |
سؤال
I have the following route:
match "sports/:sport(/:view)" => 'sports#show', as:'sport_path'
How do I call sport_path(sport, view)
? When I try:
sport_path(params[:sport], 1)
The resulting url is: /sports/5.1
. It should be /sports/5/1
(notice the dot instead of the slash)
المحلول
I had another route named sport
. face-palm
لا تنتمي إلى StackOverflow