Reputation: 2681
Here is what I have. I have a action and I can see the route by rake routes
date_swimming_classschedules GET /swimming/classschedules/date/:date(.:format) swimming/classschedules#date
I tried to generate the url in my view my using
'<%= date_swimming_classschedules(@date)%>'
I got an error message
undefined method `date_swimming_classschedules'
Something I am missing?
Upvotes: 2
Views: 106
Reputation: 23483
Yes, you are missing _path
on your method call. Do:
date_swimming_classschedules_path(@date)
Upvotes: 2
Reputation: 6030
You have to append _path
to the named route.
do it like this.
date_swimming_classschedules_path(@date)
Upvotes: 3
Reputation: 35533
Try
date_swimming_classschedules_path(@date)
or
date_swimming_classschedules_url(@date)
Upvotes: 5