Hi I am trying to pass these local parameters to a partial form, and they are being passed to hidden_fields. I can't put the values straight into the forms because they will change. Any help would be greatly appreciated.
I have:
<% form_for :user, @user, :url => { :action => "create", :controller => "users"} do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f, :position => 'Company Commander', :battalion_id => @battalion.id, :company_id => c.id} %>
<%= f.submit "Register" %>
<% end %>
The _form.html
<%= f.hidden_field (:position, :value => :position) %>
<%= f.hidden_field (:battalion_id, :value => @battalion.id) %>
<%= f.hidden_field (:battalion_id, :value => @company.id) %>
<%= f.hidden_field (:roles, :value => "Company") %>
<%= f.label (:name, "Name:") %>
<%= f.text_field :name%>
<br />
<%= f.label (:login, "Login:") %>
<%= f.text_field :login %>
<br />
<%= f.label (:email, "E-Mail:") %>
<%= f.text_field :email%>