form_forを使用してこれを記録するにはどうすればよいですか?form_for radio_button rails
<div class="form-group">
<div class="cc-selector">
<%= f.radio_button :priorities, id: "yellow", name: "priorities", value: '1'%>
<input id="a" type="radio" name="priorities" value=1/>
<label class="priorities-cc yellow" for="a"></label>
<input id="b" type="radio" name="priorities" value=2/>
<label class="priorities-cc orange" for="b"></label>
<input id="c" type="radio" name="priorities" value=3/>
<label class="priorities-cc red" for="c"></label>
<input id="c" type="radio" name="priorities" value=4/>
<label class="priorities-cc fair" for="d"></label>
</div>
</div>
Iこの 他のフィールドは、データベース <% = f.radio_buttonに格納されて動作しない、試み:is_code、[1、B 2、C 3、D、4 ]%>
ありがとうございました!文字列である、私は他のすべてinput
タグ参照
私はちょうど 'f.radio_button'を見ると、フォーム、送信ボタン、それを受け取る方法がありますか? –
@SebastiánPalmaはい。他のフィールドはデータベースに書き込まれます – Helga