On Oct 11, 11:45 am, Erol Fornoles <[email protected]> wrote:
> I prefer this approach:
>
> Have the following routes setup:
>
> map.resources :artists do |artists|
>   artists.resources :paintings
> end
> map.resources :paintings
[...]
> If an Artist is specified, via the URL /artists/1/paintings, it will
> load all Paintings from the specified Artist and render the view named
> 'index_by_artist'.
> If no Artist is given, using just the URL /paintings, it will load all
> Paintings and use the default view 'index'.

This is certainly how I would do it.  You've got a classic nested-
resources situation here.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
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.

Reply via email to