# Start\_form\_tag with method GET

**URL:** <https://www.ruby-forum.com/t/start-form-tag-with-method-get/71396>\
**Category:** Rails\
**Created:** [February 21, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/start-form-tag-with-method-get/71396 "2006-02-21T17:35:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [February 21, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/start-form-tag-with-method-get/71396/1 "2006-02-21T17:35:42Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [February 21, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/start-form-tag-with-method-get/71396/2 "2006-02-21T19:12:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [February 21, 2006, 11:37pm UTC](https://www.ruby-forum.com/t/start-form-tag-with-method-get/71396/3 "2006-02-21T23:37:40Z")

</div>

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. \<
