Hey all, I have the following route which nests a has_many :through
association:
map.resources :groups do |group|
group.resources :enrollments
end
With that I can hit urls like: /groups/1/enrollments
While this works, the url sounds rather utilitarian (probably should have
thought about that when naming). Anyway, my question is, is there a param I
can pass to group.resources specify a custom name for that piece in the url?
/groups/1/*members*
Thanks,
Nathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 6/13/07, blinking bear <blinkingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey all, I have the following route which nests a has_many :through > association: > > > map.resources :groups do |group| > group.resources :enrollments > end > > > With that I can hit urls like: /groups/1/enrollments > > > While this works, the url sounds rather utilitarian (probably should have > thought about that when naming). Anyway, my question is, is there a param I > can pass to group.resources specify a custom name for that piece in the url? > > /groups/1/membersgroups.resources :members http://rails.rubyonrails.org/classes/ActionController/Resources.html There is a :controller option if you still want to use the enrollments controller. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---