Rails 4.0.0 を使用しており、追加する関連付けを 3 つに制限したいフォームがあります。これを行う最もクリーンな方法は何ですか?
= nested_form_for(@donation) do |f|
= render 'shared/error_messages', object: f.object
= f.fields_for :donation_devices do |f2|
%p
= f2.collection_select(:device_model_id, DeviceModel.all, :id, :name)
= f2.link_to_remove "Remove Device"
= f.link_to_add "Add Device", :donation_devices