I just wrote, in a post on a different topic:> resources :users > resources :decisions > resources :alternatives > resources :factors > end > end > > (Whether things should be nested under users in the first place, is > another question. I''ll start another thread for that.)I''ve rarely seen the above sort of thing (nesting things under users) done, but it does make sense to me. What do y''all perceive as the tradeoffs? Thanks, Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Nov 23, 2011 at 6:57 PM, Dave Aronson < googlegroups2dave-BRiZGj7G2yRXqviUI+FSNg@public.gmane.org> wrote:> I just wrote, in a post on a different topic: > > > resources :users > > resources :decisions > > resources :alternatives > > resources :factors > > end > > end > > > > (Whether things should be nested under users in the first place, is > > another question. I''ll start another thread for that.) > > I''ve rarely seen the above sort of thing (nesting things under users) > done, but it does make sense to me. What do y''all perceive as the > tradeoffs? > > Thanks, > Dave > >Hi! Try this: resources :users resources :decisions resources :alternatives resources :factors I don''t think there is a reason for nesting. Are you using the generated nested route paths? If you don''t, maybe there are no reason to use nested resources. Best Regards, Everaldo> -- > LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern > languages. > Where: Northern Virginia, Washington DC (near Orange Line), and remote > work. > See: davearonson.com (main) * codosaur.us (code) * dare2xl.com(excellence). > Specialization is for insects. (Heinlein) - Have Pun, Will Babble! > (Aronson) > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Nov 23, 2011 at 16:04, Everaldo Gomes <everaldo.gomes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try this: > resources :users > resources :decisions > resources :alternatives > resources :factorsThat''s how I''ve already got the app working; the nested version was something I wanted to try since it seemed more in tune with REST. See my post under the thread "resource nesting for spreadsheet-like app?". In this thread here, I''m just looking for opinions on whether nesting things under users is a good or bad thing, regardless of other nesting. Thanks, Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Nov 23, 4:18 pm, Dave Aronson <googlegroups2d...-BRiZGj7G2yRXqviUI+FSNg@public.gmane.org> wrote:> On Wed, Nov 23, 2011 at 16:04, Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Try this: > > resources :users > > resources :decisions > > resources :alternatives > > resources :factors > > That''s how I''ve already got the app working; the nested version was > something I wanted to try since it seemed more in tune with REST. See > my post under the thread "resource nesting for spreadsheet-like app?". > > In this thread here, I''m just looking for opinions on whether nesting > things under users is a good or bad thing, regardless of other > nesting. > > Thanks, > Dave > > -- > LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. > Where: Northern Virginia, Washington DC (near Orange Line), and remote work. > See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). > Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)if you''re using a controller that NEEDS properties from a parent, use nested routes. if you''re using a controller that can assume the parent, or it can be contrived, don''t nest. example: users controller, using devise for authentication, giving you the current_users variable private information singleton controller for data being stored only for the current user, and not to be seen by other users contact information controller, which stores personal contact information, some of which can be seen by all users, depending on privacy settings resources :users do resources :contacts end resources :user_confidential that''s how I approach it - however there is no right or wrong way to do it. just remember routes provide information to a controller, and aren''t necessarily a representation of models (though that''s a great place to start). hope that helps. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.