Imagine i have an application with channels and videos
A channel contains videos.
So i have in my routes.rb:
map.resources :channels, :has_many => :videos
But i have one problem: some actions concern all videos across all
channels.
So say i add in my routes.rb:
map.resources :videos
on top of the one above.
The problem is that both routes point to the same controller :
VideosController.
This controller risks becoming a little awkward.
What is your advice ? how to cleanly split this ? use namespaces ?
Thank you,
(I may be mistaken, but I think the ap.resources :channels, :has_many =>
:videos provides also the non-nested routes)
I guess my controllers are akward by your standards but when I face
this requirement I usually just check if the parent object exists or
not. So in by before_filter I do: