Hello,
I'm new to rails and having trouble figuring out how to do this RESTfully. I have a route set as map.resources :products
and what I want to do is have some way to filter the results returned from the index action. For example, you go to /products which calls the index action per the resources default, then on that page there is a filter form on the left side. You may check certain filter options and then submit this form, which would then just render basically the same page, but with filtered results (i.e. everything that costs less than $X).
Originally I was thinking to just check the HTTP method in the products controller's index method, if get, display as normal, if post, apply filter. However, this is not RESTful and I would like to figure out a RESTful way to do this, which is also elegant (code-wise). Thank you for the help.
I guess I could use a query string, but I would prefer to keep the url clean as once it's working normally I'd like to use some AJAX to update the list on the fly.