only one form_helper per rhtml in rails?

R

red

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:
<b>Gehaltsabrechnung ansehen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'show' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= select:)invoice, :monat, 1..12) %>
<%= submit_tag "show" %>
<% end_form_tag %>
<br><br>
<b>Gehaltsabrechnung erstellen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'create' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= 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
 
R

red

red said:
CODE:
<b>Gehaltsabrechnung ansehen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'show' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= select:)invoice, :monat, 1..12) %>
<%= submit_tag "show" %>
<% end_form_tag %>
<br><br>
<b>Gehaltsabrechnung erstellen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'create' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= select:)invoice, :monat, 1..12) %>
<%= submit_tag "Create" %>
<% end_form_tag %>

found the problem - new syntax for the form_tag - now with "do"

greetz red
 
J

John Joyce

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:
<b>Gehaltsabrechnung ansehen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'show' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= select:)invoice, :monat, 1..12) %>
<%= submit_tag "show" %>
<% end_form_tag %>
<br><br>
<b>Gehaltsabrechnung erstellen:</b><br>
<%= form_tag :controller => 'invoices',
:action => 'create' %>
<label for="invoice_jahr">Jahr:</label>
<%= select:)invoice, :jahr, 2007..2107) %>
<label for="invoice_monat">Monat:</label>
<%= 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
Both of your forms can work, each form can call to a different method
in the controller.
Double check your form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top