是否可以在这样的一种形式上具有相同的关联?
<%= f.association :classifications, label: "Recipient", collection: @classifications, input_html: {class: "parent_recipients"}, as: :collection_select %>
<%= f.association :classifications, label: "Sub-recipient", collection: @sub_classifications, input_html: {class: "sub_recipients"}, as: :collection_select %>
以便用户可以从这两个选择框中进行选择并将两个条目都保存到数据库中?
编辑:
<%= f.simple_fields_for :classifications do |c| %>
<%= f.input :classification_ids, label: "Recipient", collection: @cat, as: :collection_select %>
<%= f.input :classification_ids, label: "Sub-recipient", collection: @sub, as: :collection_select %>
<% end %>