Herman Müller schreef:
I have a problem with nested resources.
Ich made following entries in the routes.rb:
map.resources :projects do |project|
project.resources :iterations do |iteration|
when I use link_to:
<%= link_to 'Show', project_iteration_task_path(task.iteration.project,
following is displayed:
The problem is, that the IDs of iterations and task are interchanged.
The real iteration_id = 32 and the real task_id = 117.
do sombebody knows a solution or what's worn with the code?
Thanks for every answer!
You can try the alternative syntax:
map.resources :iterations, :has_many => [:tasks]
map.resources :projects, :has_many => [:iterations]