# RESTful nested routes =\> generated method names?

**URL:** <https://www.ruby-forum.com/t/restful-nested-routes-generated-method-names/118712>\
**Category:** Rails\
**Created:** [October 30, 2007, 11:21am UTC](https://www.ruby-forum.com/t/restful-nested-routes-generated-method-names/118712 "2007-10-30T11:21:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [October 30, 2007, 11:21am UTC](https://www.ruby-forum.com/t/restful-nested-routes-generated-method-names/118712/1 "2007-10-30T11:21:09Z")

</div>

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
