I have a search form on my site that allows the user to search for various aspects such as city, price range, size, etc.
the form is submitted as GET, so the form parameters are in the url.
they are ultimately pretty ugly:
/ search utf8 = β &? City_region = Vancouver & property_type_id = 1 & min_square_footage = 0 & max_square_footage = 15000
(they are actually even worse because the search parameters are part of the model, so there are a lot of encoded [and] in the URL)
what I would like to do instead has a form generating a URL, for example:
/ search / vancouver / office? = Area in square feet above sea level 0-15000
where some parameters are placed in the URL path, and the rest remain in the request parameters (in a slightly more readable format).
What would be the best way to handle this in a rails application? all i can think of is to use javascript code in the submit form to manipulate the url that the form represents.
ruby-on-rails forms
emh
source share