Dear list,
Currently I am working on my first REST application and so far I really like te clairity it brings to the project but there is one thing I do not understand. My routes.rb looks something like this: map.resources :projects do |projects| projects.resources :forums, :has_many =>[:posts] do |forum| forum.resources :topics, :name_prefix => nil do |topic| topic.resources :posts, :name_prefix => nil topic.resource :monitorship, :controller => :monitorships, :name_prefix => nil end end map.resources :posts, :name_prefix => 'all_', :collection => { :search => :get } end
I was under the impression that calling fourm_path(@project, @forum) would be valid. However this is not. I need to call project_forum_path(@project, @forum). Alright I can go with that, but a little further on I want to create a edit link for a topic: edit_topic_path(@project, @forum, @topic). This works! Why? I would expect project_forum_edit_topic(@project, @forum, @topic) or edit_project_forum_topic(@project, @forum, @topic). Can someone shed some light on this?
Thanks a lot in advance! Harm