これをメインフォームに持っています
<%= 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%>
そして、私はこれを私のcustomer_bill_line_itemsに持っています
<%= f.hidden_field :customer_id, :value => :text_1 %>
/*rest of code*/
しかし、選択した顧客IDを部分的にキャプチャできません。非表示フィールドの値が 0 になります。この問題を解決する方法についてのガイダンスは素晴らしいでしょう。前もって感謝します