Newbie - form_tag with get?

I can’t create a form with method “get”.

The rhtml code:
<%= form_tag :controller => ‘teritory’, :action => ‘add’, :method =>
‘get’ %>

The generated html code:

What i’m doing wrong?


They say money can’t buy happiness? Look at the smile on my face… ear
to ear, baby!

In api.rubyonrails.org you have:

start_form_tag(url_for_options = {}, options = {}, *parameters_for_url)

Options:
:multipart - If set to true, the enctype is set to
“multipart/form-data”.
:method - The method to use when submitting the form, usually either
“get” or “post”.

So you need to specify :method as the second hash (options = {}):
start_form_tag({:controller => ‘’, :action => ‘’, :sth => ‘’}, :method
=> ‘get’)

That should work.

Cam pe la 03/23/2006 07:17 PM, szymek scrise:

So you need to specify :method as the second hash (options = {}):
start_form_tag({:controller => ‘’, :action => ‘’, :sth => ‘’}, :method
=> ‘get’)

Thanks. I tried that too, but I wasn’t using (). I’m still not that
familiar with ruby.

form_tag ({:controller => ‘territory’, :action => ‘add’}, {:method =>
‘get’})


They say money can’t buy happiness? Look at the smile on my face… ear
to ear, baby!