I'm developing simple image sharing site to train my ruby-on-rails-fu. I have following resources in my config/routes.rb
file.
resources :users do
resources :images
end
resources :images
Here's the problem I'm facing - how should I go about implementing functionality like "latest images" and "your image subscriptions"? Having vanilla resource url's here's how it looks now:
/users/N/images # ImagesController#index action for listing all images for a user
/images # ImagesController#index action for listing all possible images from all users.
How would you go about managing the "parent" object of images when accessing index action in images controller? Would simple check for :user_id
in params
hash suffice? Are there any plugins I'm not aware of (since I could not think of a simple description for this problem).