سؤال

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top