I am creating an application with a search feature, and I would like have it set up similarly to Google or Twitter search, where there is a landing page with a search form at the root URL and then data from this form is passed through a query string, which forms the URL for the results page (for example: www.domain.com/search?query=my+search+query).
As of now, I know how to pass the data from the search for using the params hash, but I would like to know how to pass the data and access it using a query string.
My best guess is the it is done through the routing, where you include something like the following in the routing for the search action:
:query => params[name_of_search_form_element]
then access this value in the controller using the params hash, but I'm not sure if this is the best way. Any thoughts? Thanks!