# Newbie - form\_tag with get?

**URL:** <https://www.ruby-forum.com/t/newbie-form-tag-with-get/55762>\
**Category:** Rails\
**Created:** [March 23, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/newbie-form-tag-with-get/55762 "2006-03-23T17:39:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![costi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@costi](https://www.ruby-forum.com/u/costi)\
**Post date:** [March 23, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/newbie-form-tag-with-get/55762/1 "2006-03-23T17:39:42Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![costi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@costi](https://www.ruby-forum.com/u/costi)\
**Post date:** [March 23, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/newbie-form-tag-with-get/55762/2 "2006-03-23T18:17:40Z")

</div>

In [api.rubyonrails.org](http://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.

---

<div class="post-metadata">

**Author:** ![costi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@costi](https://www.ruby-forum.com/u/costi)\
**Post date:** [March 23, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/newbie-form-tag-with-get/55762/3 "2006-03-23T18:27:42Z")

</div>

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!
