[Rails] Re: Need advice on controller / view
Thanks all for the feedback. Very informative replies. At current I do
have it as a nested route as specified by Erol.
Bill has also indicated a very interesting fact. Being that index
should display ALL records, while list can be used for more specific
requests (i.e. to filter out results). I'll definitely give this a
shot. Which I believe is also a RESTful approach
On Oct 12, 3:30 am, Marnen Laibow-Koser <mar...@marnen.org> wrote:
> On Oct 11, 11:45 am, Erol Fornoles <erol.forno...@gmail.com> 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-Koserhttp://www.marnen.org
> mar...@marnen.org
--
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@googlegroups.com.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home