Hi Rails experts,
I have one doubt regarding map.resources.
I am not clear with when to use :method and :collection in
map.resources. Please help me out.
Thanks.
Hi Rails experts,
I have one doubt regarding map.resources.
I am not clear with when to use :method and :collection in
map.resources. Please help me out.
Thanks.
Nilesh K. wrote:
Hi Rails experts,
I have one doubt regarding map.resources. I am not clear with when to use :method and :collection in
map.resources. Please help me out.
Thanks.
method is for adding new actions that deal with a single instance of the
mode in question.
collection is for adding new methods that deal with, well, a collection
of the model in question.
I have:
map.resources :projects, {:collection => {:recent => :get}, :member =>
{:copy => :get, :pdf => :get}}
so I have a “recent projects” that works on the collection of
projects(returning the most recent 10), and “copy” and “pdf” that work
on an individual project.
On Wed, Oct 1, 2008 at 12:00 PM, Nilesh K. [email protected]
wrote:
Hi Rails experts,
I have one doubt regarding map.resources. I am not clear with when to use :method and :collection in
map.resources. Please help me out.
Thanks.
–
Cheers!
Thanks Chron for ur reply!
On Wed, Oct 1, 2008 at 6:16 PM, Ar Chron
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs