What''s the rationale behind the controller names of nested resources?
e.g:
map.resources :projects do |project|
project.resources :images
end
map.resources :galleries do |gallery|
gallery.resources :images
end
This results in the urls for /projects/:id/images and /galleries/:id/
images both going to the index action on the images controller. Even
if I were using a common image model and polymorphic associations I''d
thought it''d still be better to go to a project_images and
gallery_images controller otherwise you need to disambiguate whether
you need to load a project or gallery.
I know I can override the controller (extra typing) or change the
routing definition to :project_images (ugly urls), etc. But it seems
to me that the most common usage scenario would have the controller
prefixed with the singular name of the parent.
I have a patch which changes the behavior to this, but if it''s
''Not
The Right Way'' please can someone enlighten me
Andrew White
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---