I have this in the Main form
<%= simple_nested_form_for @customer_bill do |f| %>
<%= f.label :customer_id %>
<%= f.collection_select :customer_id, Customer.all,:id,:name, {:prompt => "Select Customer"}, :style => 'width:205px;' %><br />
<%= f.link_to_add "Add", :customer_bill_line_items, :locals => {:text_1 => :customer_id} %>
/* rest of code */
<%end%>
And i have this in my customer_bill_line_items Partial
<%= f.hidden_field :customer_id, :value => :text_1 %>
/*rest of code*/
But i am not Able to capture the selected customer id in the partial. The value of hidden field is coming as 0. Any guidance on how i can solve this matter will be great. Thanks in advance
I am guessing that customer_id in an integer field, and you are setting the :value as text_1 which is a string.
if the value of text_1 is an integer then text_1.to_i