5
私は、単純なフォームを使ってラジオボタンとは別のデータ属性をしようとしています。simple_formを使用してラジオボタンにデータ属性を追加します。
私は次のようにレンダリングしたい-
<input type="radio" name="special_feature[all_editions]" id="special_feature_all_editions_true" value="true" data-enables="edition_select">
<input type="radio" name="special_feature[all_editions]" id="special_feature_all_editions_false" value="false" data-disables="edition_select">
<%= f.input :all_editions,
as: :radio_buttons
%>
私はdifferrentデータ属性を追加する方法任意のアイデア?
そして、私はラジオボタンにコレクションを渡した場合、どのように私は、コレクションの値に応じて、データの属性を設定することができますか? = form.input:zip、:as:ラジオ、:collection => Zip.all、: 'data-enable_dropdown' => '??' –