Params


#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 %>

<%=:id => @house.id, params[:id], size => 0%>
Bezeichnung <%= text_field_tag :name, params[:name], :size => 40 %><%= submit_tag "Hinzufügen" %>
<%end%>

In this code i want to give back @house.id from the view to the
controller!

Thank you

Harald


#2

You should use a hidden_tag for this. “Giving back to the controller” is
done by posting http data to the controller.


#3

<% form_tag :action => :create do %>

<%= hidden_tag :id => @house.id, params[:id]%>
Bezeichnung <%= text_field_tag :name, params[:name], :size => 40 %><%= 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


#4

Hallo

Please can somebody show me how it works!

THANKS


#5

Hallo

I have solved my Problem but i have a Question. Is it possible to give
with the redirect_to also Parameters?

THANK