On Tue, May 7, 2013 at 3:38 AM, Paul Bergstrom <[email protected]> wrote:

> How do I define the route for a search form that goes to index
> action, which either lists all, if no search, or the search result?

The route can be just the same as always.  The way I've done this sort
of thing is that in the controller, it checks for search params.  If
it finds any, it does the search and passes along the result set, else
it passes along all.  (Subject to pagination if wanted.)

-Dave

-- 
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
available for contracts or temp employment.
See information at http://www.Codosaur.us/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to