Nesting a singular resource

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs