# Nesting a singular resource

**URL:** <https://www.ruby-forum.com/t/nesting-a-singular-resource/134095>\
**Category:** Rails\
**Created:** [April 7, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/nesting-a-singular-resource/134095 "2008-04-07T21:21:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chunkyslink](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f0a364/32.png) [@chunkyslink](https://www.ruby-forum.com/u/chunkyslink)\
**Post date:** [April 7, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/nesting-a-singular-resource/134095/1 "2008-04-07T21:21:06Z")

</div>

I have two resources in my routes.rb;

map.resource :people, :controller =\> :people do |people|  
people.resource :a\_to\_z, :controller =\> :people\_a\_to\_z  
end

map.resources :groups do |groups|  
groups.resource :a\_to\_z, :controller =\> :groups\_a\_to\_z  
end

‘People’ is a singular resource, and ‘Groups’ are resources. This means  
that the people\_a\_to\_z works just fine with the url of people/a\_to\_z,  
but the groups\_a\_to\_z doesn’t work because the routes.rb is expecting a  
groups/:id/a\_to\_z. Is there any way that I can get the a\_to\_z to work  
with my groups in the same way that it does with people?

p.s. the People resource is there to take a task away from a Users  
controller, therefore making the URLs look more in line with  
navigational conventions. I could’ve chosen People / Person naming from  
the offset, but I chose User because of all the tutorials and plugins  
I’m using for my learning; ‘User’ seems to standard naming convention.
