Start_form_tag with method GET


#1

Hi,

How can I get start_form_tag to use GET instead of POST?

I have tried…

<%= start_form_tag {:action => ‘search’}, {:method => ‘get’} %>

But it doesn’t work…

compile error
./script/…/config/…/app/views/search/index.rhtml:35: syntax error
_erbout.concat(( start_form_tag {:action => ‘search’}, {:method =>
‘get’} ).to_s); _erbout.concat “\n”
^
./script/…/config/…/app/views/search/index.rhtml:35: syntax error
_erbout.concat(( start_form_tag {:action => ‘search’}, {:method =>
‘get’} ).to_s); _erbout.concat “\n”


#2

On Tuesday, February 21, 2006, at 5:35 PM, Martin Smith wrote:

Hi,

How can I get start_form_tag to use GET instead of POST?

I have tried…

<%= start_form_tag {:action => ‘search’}, {:method => ‘get’} %>

Here is how I have done it:

<%= form_tag({:action => ‘results’}, :method => ‘get’) %>

I think perhaps you’re just missing the parenthesis.


#3

Martin,

You can also use a symbol… here is an extract from some code…

<%= link_to_remote ‘edit’,
:url => edit_customer_url(:model_number => @customer.customer_number),
:method => :get,
:update => ‘edit_’ + css_id_for(@customer),
:success => “Element.toggle(‘show_#{css_id_for(@customer)}’,
‘edit_#{css_id_for(@customer)}’)”,
:failure => “alert(‘An error occurred. Please try again.’)” %>

Hope this helps,
Zack

On 21 Feb 2006 18:10:11 -0000, Joshua S. <