Lets say I''ve got this mapped out map.resources :owners do |owners| owners.resources :possessions This gives me routes looking like this: .../owners/:id/ .../owners/:owner_id/possessions/:id/ I''m very frustrated that the routes do not look like this: .../owners/:owner_id/ .../owners/:owner_id/possessions/:possession_id/ This causes problems when I want to share code between these controllers that uses either. params[:id] <-- meaning the id of the owner params[:owner_id] Lord this gets my goat and jives my Johnson the wrong way. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Lets say I''ve got this mapped out map.resources :owners do |owners| owners.resources :possessions This gives me routes looking like this: .../owners/:id/ .../owners/:owner_id/possessions/:id/ I''m very frustrated that the routes do not look like this: .../owners/:owner_id/ .../owners/:owner_id/possessions/:possession_id/ This causes problems when I want to share code between these controllers that uses either. params[:id] <-- meaning the id of the owner params[:owner_id] Lord this gets my goat and jives my Johnson the wrong way. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have you taken a look at makes_resourceful? Even if you don''t use the plugin itself, you can nick its code for things like the current_object method. --Jeremy On 8/17/07, Collin Miller <collintmiller-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Lets say I''ve got this mapped out > > map.resources :owners do |owners| > owners.resources :possessions > > This gives me routes looking like this: > > .../owners/:id/ > .../owners/:owner_id/possessions/:id/ > > I''m very frustrated that the routes do not look like this: > > .../owners/:owner_id/ > .../owners/:owner_id/possessions/:possession_id/ > > This causes problems when I want to share code between these > controllers that uses either. > > params[:id] <-- meaning the id of the owner > params[:owner_id] > > Lord this gets my goat and jives my Johnson the wrong way. > > > > >-- http://www.jeremymcanally.com/ My free Ruby e-book: http://www.humblelittlerubybook.com/book/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.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 -~----------~----~----~----~------~----~------~--~---
Holy wow! I like the look of makes_resourceful. Thanks. On Aug 17, 4:26 pm, "Jeremy McAnally" <jeremymcana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you taken a look at makes_resourceful? Even if you don''t use the > plugin itself, you can nick its code for things like the > current_object method. > > --Jeremy > > On 8/17/07, Collin Miller <collintmil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Lets say I''ve got this mapped out > > > map.resources :owners do |owners| > > owners.resources :possessions > > > This gives me routes looking like this: > > > .../owners/:id/ > > .../owners/:owner_id/possessions/:id/ > > > I''m very frustrated that the routes do not look like this: > > > .../owners/:owner_id/ > > .../owners/:owner_id/possessions/:possession_id/ > > > This causes problems when I want to share code between these > > controllers that uses either. > > > params[:id] <-- meaning the id of the owner > > params[:owner_id] > > > Lord this gets my goat and jives my Johnson the wrong way. > > --http://www.jeremymcanally.com/ > > My free Ruby e-book:http://www.humblelittlerubybook.com/book/ > > My blogs:http://www.mrneighborly.com/http://www.rubyinpractice.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 -~----------~----~----~----~------~----~------~--~---
> Holy wow! I like the look of makes_resourceful.Isn''t it make_resourceful ? Wybo> Thanks.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yeah, it is. And it is wonderful. On Aug 18, 5:49 am, Wybo Wiersma <w...-T49n2wj3Ml5g9hUCZPvPmw@public.gmane.org> wrote:> > Holy wow! I like the look of makes_resourceful. > > Isn''t it make_resourceful ? > > Wybo > > > Thanks.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---