I need to extend a RESTful controller (ads) with two aditional actions (search and coincidences), so I include the following code in my routes.rb file: map.resources :ads, :collection => {:coincidences => :get} map.resources :ads, :collection => {:search => :get} however, I can only get one of these sentences to work - the one that comes first. The second one seems to be ignored. How can it be fixed? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
map.resources :ads, :collection => {:coincidences => :get, :search => :get} On Jul 3, 8:23 pm, Abel <abel.tam...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I need to extend a RESTful controller (ads) with two aditional actions > (search and coincidences), so I include the following code in my > routes.rb file: > > map.resources :ads, :collection => {:coincidences => :get} > map.resources :ads, :collection => {:search => :get} > > however, I can only get one of these sentences to work - the one that > comes first. The second one seems to be ignored. > > How can it be fixed?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Thanks Wolas, worked like a charm. I knew it had to be something as easy as that, but couldn''t find any examples. Thanks again. On Jul 3, 10:03 pm, "\"Wolas!\"" <jcpen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> map.resources :ads, :collection => {:coincidences => :get, :search > => :get} > > On Jul 3, 8:23 pm, Abel <abel.tam...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I need to extend a RESTful controller (ads) with two aditional actions > > (search and coincidences), so I include the following code in my > > routes.rb file: > > > map.resources :ads, :collection => {:coincidences => :get} > > map.resources :ads, :collection => {:search => :get} > > > however, I can only get one of these sentences to work - the one that > > comes first. The second one seems to be ignored. > > > How can it be fixed?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Abel: I saw it and I had to comment... a search doesn''t really need its own additional action. Search just returns records (in your case, ads), but with a filter applied. Generally, if you''re doing RESTful design, Search forms just do GET to the Index action, and the controller checks parameters to determine how the results get populated. On Thu, Jul 3, 2008 at 3:16 PM, Abel <abel.tamayo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks Wolas, worked like a charm. I knew it had to be something as > easy as that, but couldn''t find any examples. > Thanks again. > > On Jul 3, 10:03 pm, "\"Wolas!\"" <jcpen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > map.resources :ads, :collection => {:coincidences => :get, :search > > => :get} > > > > On Jul 3, 8:23 pm, Abel <abel.tam...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I need to extend a RESTful controller (ads) with two aditional actions > > > (search and coincidences), so I include the following code in my > > > routes.rb file: > > > > > map.resources :ads, :collection => {:coincidences => :get} > > > map.resources :ads, :collection => {:search => :get} > > > > > however, I can only get one of these sentences to work - the one that > > > comes first. The second one seems to be ignored. > > > > > How can it be fixed? > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---