0
我想知道 - 我有兩個模型,Device has many Phones
,反之亦然。在手機的形式中,我有一個設備選擇。我不能讓空值被插入到這個選擇,但不知何故,我需要的,如果沒有設備associated.I顯示沒有價值無法弄清楚如何使用javascript顯示空白選擇模型是否與另一個模型沒有關聯
= f.input :device_ids, include_blank: false, label: false, as: :select, collection: current_user.devices, input_html: {id: "phone_number_#{phone_number.id}_device_ids", disabled: (true if phone_number.multiring)}
我怎樣才能解決這個問題?