lundi 22 mai 2017

form_for radio_button rails

How do I record this using form_for?

<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 tried, this don't work The other fields are stored in the database <%= f.radio_button :is_code, [a,1,b,2,c,3,d,4] %>

Thanks a lot for your help!




Aucun commentaire:

Enregistrer un commentaire