guest
June 20, 2007, 8:37am
1
Hallo
I have the Problem that i give a parameter from the the Controller to
the view and then i want to give back that Parameter from the view to
the controller! But it doesn’t work. Please can somebody help me!
<% form_tag :action => :create do %>
Bezeichnung
<%= text_field_tag :name, params[:name], :size => 40 %>
<%=:id => @house.id, params[:id], size => 0%>
<%= submit_tag "Hinzufügen" %>
<%end%>
In this code i want to give back @house.id from the view to the
controller!
Thank you
Harald
guest
June 20, 2007, 8:41am
2
You should use a hidden_tag for this. “Giving back to the controller” is
done by posting http data to the controller.
guest
June 20, 2007, 8:54am
3
<% form_tag :action => :create do %>
Bezeichnung
<%= text_field_tag :name, params[:name], :size => 40 %>
<%= hidden_tag :id => @house.id, params[:id]%>
<%= submit_tag "Hinzufügen" %>
<%end%>
Thanks for your fast reply but when i use this hidden_tag i get an
error! Can somebody please show me how it works!
THANK you
Harald
guest
June 20, 2007, 9:47am
4
Hallo
Please can somebody show me how it works!
THANKS
guest
June 20, 2007, 10:55am
5
Hallo
I have solved my Problem but i have a Question. Is it possible to give
with the redirect_to also Parameters?
THANK