I am having trouble with some Ruby on Rails code. I have a data structure of nested resources (List has_many Tasks and a Task belongs_to a List). On my List.show page, I have the following line of code:
<td><%= link_to 'Show Task', list_tasks_path(@list, task) %></td>
The idea is that this page will link to a "show" page where I can view the details of an individual Task. I want the url to basically be
/lists/:list_id/tasks/:task_id
The problem is that the above code is directing me to
/lists/:list_id/tasks.task_id
on the index page of Task. How can I tell Rails to send me to the show page instead?
I have tried adding :action => show and :controller => tasks, as well as using show_list_tasks_path(@list, task). I also know that the structure itself is there because my show page works fine if I manually enter /lists/:list_id/tasks/:task_id.
Any help is appreciated. Thank you!
-Sum