自定义集合单选按钮简单形式

时间:2017-08-25 12:45:18

标签: ruby-on-rails simple-form

我自定义了我的表单中的收藏单选按钮,当值是一个简单的字符串选项时,一切正常,但是当它的这种类型的字段保存选择值时我不成功

原始字段

<%= f.collection_radio_buttons(:negociateur, Nego.where(user: current_user), :first_name, :first_name) %> 

我试图做什么

<div class="btn-group" data-toggle="buttons">
          <% @negos.where(user: current_user).each do |n| %>
            <label class="btn btn-danger" style="margin-right: 10px;">
              <input id="bien_negociateur_true" name="bien[negociateur]" type="radio" autocomplete="off" value= '<% n.first_name %>' /* the problem is here */ /> <%= n.first_name %>
            </label>
          <% end %>
        </div>

0 个答案:

没有答案
相关问题