Hallo,

ich habe ein Problem mit nested resources.

Ich habe in der routes.rb folgenden Eintrag:

  map.resources :projects do |project|
    project.resources :iterations do |iteration|
      iteration.resources :tasks
    end
  end

wenn ich folgenden Link ausgeben will über:

<%= link_to 'Show', project_iteration_task_path(task.iteration.project,
task) %>

bekomme ich folgenden Link angezeigt:

http://localhost:3000/projects/2/iterations/117/tasks/32

Das Problem ist jedoch, dass die die IDs von iterations und task
vertauscht werden. Also eigentlich ist die iteration_id = 32  und die
task_id = 117.

Kennt jemand eine Lösung für mein Problem bzw. was mache ich falsch?

Vielen Dank im voraus!
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug

Antwort per Email an