0
最初のドロップダウンから選択した値に基づいてドロップダウンオプションを設定する方法はありますか?コレクションは最初のドロップダウン値を選択して選択します
私は今の私は、製品と色を選択する私の見解では、以下の持っているが、私は
<td><%= f.collection_select(:product_id, Product.active.all, :id, :name, :prompt => 'Select Product') %></td>
<td><%= f.collection_select(:color_id, Color.all, :id, :name, :prompt => 'Select Color') %></td>
Product has_many :colors
Color has_and_belongs_to_many :products
ありがとう。私は前に試したが、それは古すぎる。私はRails 3より前のすべてを無視し、jQuery(JSは私の紅茶ではありません)を使用しています。 – Gaelle