<%= hidden_field ''participant'',
''event_id'', ''value'' => params[:event_id]
%>
On 7/1/05, Hariharan Gopalan
<hariom100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hope some one can help me with this:
>
> Am trying to set a hidden field in a form to a post variable.
>
> The form is called like this:
>
> <td><%= link_to_image "Register", :controller
=>"participant", :action
> => "new", :event_id => @event.id %></td>
>
> This calls the new form for the participant with the correct event_id
> like below:
>
> http://localhost/participants/new?event_id=16
>
> And I have this in the _form.rhtml for the participants view:
>
> <%= hidden_field ''participant'',
''event_id'', ''value'' => ??????? %>
>
> This is where my confusion is, how can I get the post variable of
> event_id to this hidden_fields value?
>
> Do I need to do anything in the controller too?
>
> Thanks very much.
> Hari
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>