I’m using the restful2 application from the Agile Web D. with
Rails
and have added a search to the articles_controller.rb and added the
route to the routes.rb as: map.resources :articles, :collection =>
{:search => :get }
I need some help on how to call the function. I get the error:
“no route found to match “/search” with {:method=>:get}”
when using this code on the index.rhtml form:
I’m using the restful2 application from the Agile Web D. with
Rails
and have added a search to the articles_controller.rb and added the
route to the routes.rb as: map.resources :articles, :collection =>
{:search => :get }
I need some help on how to call the function. I get the error:
“no route found to match “/search” with {:method=>:get}”
when using this code on the index.rhtml form:
wont work because you dont have a route defined for it. In your
routes.rb file you've told rails that the search action is a collection
related to articles, so your URL would be:
/articles;search
If you want it to be /search then you’d need to add: