views:

59

answers:

3

Hi - How do I get a form to submit it's params in the url, such that the rendered page will contain the query (rails 2.3)?

Something like this:

example.com/search?name=john&age=25&city=atlanta

Simple, I know, but I'm not sure how to do it... :)

thanks.

+2  A: 

This is not specific to Rails. Just set the method attribute of the form to GET.

Jimmy Cuadra
+2  A: 

as stated by Jimmy: make sure your form-tag looks like this:

<form method="get" .....>
zilverdistel
A: 

If you're using routing helpers to do this use:

search_path(:name => "John", :age => 25, :city => "atlanta")
Ryan Bigg