On Jan 20, 9:58 am, "[email protected]" <[email protected]> wrote: > > It depends on the resource and how you want to access it, but I > generally do. > > I didn't see it mentioned in here, but if you don't use something like > make_resourceful or inherited_resource you should consider it to DRY > up your CRUD based controllers. The reason I mention that is that if > you use those then nested or not your controller code wouldn't change > (if you don't want to use one you can always copy their design pattern > to allow the same axiom of your code). Then it becomes a question of > routes and of what you want to type for the path. I.e. do you want to > do > a_b_path(@a, @b) > That means that you'll have the nested one because you need it (for > create and index for sure) and then you can decide whether you want to > enforce it for show as well (i.e. hide the Bs/1 URL > > , whether you have the un-nested route or not really is just a matter > of if you want to expose that URL, since the controller won't change > at all.
Oops, I clicked some key combination that posted prematurely. That last incoherent part should be: Then it becomes a question of routes and of what you want to type for the path. I.e. do you want to do a_b_path(@a, @b) or b_path(@b) The second is obviously shorter, but then you need to do @b.a to get at its parent rather than @a if that matters for your application. \Peter -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

