# Only one form\_helper per rhtml in rails?

**URL:** <https://www.ruby-forum.com/t/only-one-form-helper-per-rhtml-in-rails/113182>\
**Category:** Ruby\
**Created:** [August 28, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/only-one-form-helper-per-rhtml-in-rails/113182 "2007-08-28T14:02:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![red](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@red](https://www.ruby-forum.com/u/red)\
**Post date:** [August 28, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/only-one-form-helper-per-rhtml-in-rails/113182/1 "2007-08-28T14:02:08Z")

</div>

hi,

i’m writing an short rails-app for some friends of mine and now i came  
over an strange error?!?!

i wrote an rhtml with 2 forms (both with form helpers), the only  
difference of them is that they use call different actions of the same  
controller.

CODE:  
**Gehaltsabrechnung ansehen:**  
  
\<%= form\_tag :controller =\> ‘invoices’,  
:action =\> ‘show’ %\>  
Jahr:  
\<%= select(:invoice, :jahr, 2007…2107) %\>  
Monat:  
\<%= select(:invoice, :monat, 1…12) %\>  
\<%= submit\_tag “show” %\>  
\<% end\_form\_tag %\>  
  
  
  
**Gehaltsabrechnung erstellen:**  
  
\<%= form\_tag :controller =\> ‘invoices’,  
:action =\> ‘create’ %\>  
Jahr:  
\<%= select(:invoice, :jahr, 2007…2107) %\>  
Monat:  
\<%= select(:invoice, :monat, 1…12) %\>  
\<%= submit\_tag “Create” %\>  
\<% end\_form\_tag %\>

now i have the problem that only the first form works - if i submit on  
the second one the action of the first one is performed!!!

please help!!!

greetz red

---

<div class="post-metadata">

**Author:** ![red](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@red](https://www.ruby-forum.com/u/red)\
**Post date:** [August 28, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/only-one-form-helper-per-rhtml-in-rails/113182/2 "2007-08-28T14:17:09Z")

</div>

red wrote:

> 

found the problem - new syntax for the form\_tag - now with “do”

greetz red

---

<div class="post-metadata">

**Author:** ![red](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@red](https://www.ruby-forum.com/u/red)\
**Post date:** [August 28, 2007, 2:48pm UTC](https://www.ruby-forum.com/t/only-one-form-helper-per-rhtml-in-rails/113182/3 "2007-08-28T14:48:12Z")

</div>

On Aug 28, 2007, at 7:01 AM, red wrote:

> **Gehaltsabrechnung ansehen:**  
>   
> \<%= form\_tag :controller =\> ‘invoices’,  
> the second one the action of the first one is performed!!!
> 
> please help!!!
> 
> greetz red

Both of your forms can work, each form can call to a different method  
in the controller.  
Double check your form.
