Hi, I''ve got some nested resources. I have a model called Feature, and FeatureRelation. When I created the standard routes for nesting (:has_many on Feature), I get a path like: features/1234/feature_relations What I''d like is: features/1234/relations Is this possible to do? I looked at the API and nothing jumped out at me indicating it is?! Thanks, Matt --~--~---------~--~----~------------~-------~--~----~ 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 12/19/07, goodieboy <goodieBoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''ve got some nested resources. I have a model called Feature, and > FeatureRelation. When I created the standard routes for nesting > (:has_many on Feature), I get a path like: > > features/1234/feature_relations > > What I''d like is: > > features/1234/relations > > Is this possible to do? I looked at the API and nothing jumped out at > me indicating it is?!I don''t believe so with :has_many, but I think that dropping back to less automation and do something like: map.resource :features do | feature | feature.resources :relations, :controller => "feature_relation" end -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.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 -~----------~----~----~----~------~----~------~--~---
Instead of feature relation name it as relation Sent from my iPhone On Dec 19, 2007, at 7:48 AM, goodieboy <goodieBoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''ve got some nested resources. I have a model called Feature, and > FeatureRelation. When I created the standard routes for nesting > (:has_many on Feature), I get a path like: > > features/1234/feature_relations > > What I''d like is: > > features/1234/relations > > Is this possible to do? I looked at the API and nothing jumped out at > me indicating it is?! > > Thanks, > Matt > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
See, I was going to say this but he might have many relations. Or he could just be really bad at naming objects. This post (and others) is going to serve as the basis of my next presentation. Thanks for the inspiration. On Dec 20, 2007 3:19 PM, Bcp <bcparanj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Instead of feature relation name it as relation > > Sent from my iPhone > > On Dec 19, 2007, at 7:48 AM, goodieboy <goodieBoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > I''ve got some nested resources. I have a model called Feature, and > > FeatureRelation. When I created the standard routes for nesting > > (:has_many on Feature), I get a path like: > > > > features/1234/feature_relations > > > > What I''d like is: > > > > features/1234/relations > > > > Is this possible to do? I looked at the API and nothing jumped out at > > me indicating it is?! > > > > Thanks, > > Matt > > > > > > >-- Ryan Bigg http://www.frozenplague.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I have made a PATCH which would allow you to do just that.. http://dev.rubyonrails.org/ticket/10578 On Dec 19, 8:48 pm, goodieboy <goodie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''ve got some nestedresources. I have a model called Feature, and > FeatureRelation. When I created the standard routes for nesting > (:has_many on Feature), I get a path like: > > features/1234/feature_relations > > What I''d like is: > > features/1234/relations > > Is this possible to do? I looked at the API and nothing jumped out at > me indicating it is?! > > Thanks, > Matt--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---