我有以下红宝石:
<%= simple_form_for @answer, url: presentation_survey_path(@presentation) do |f| %>
<%= f.collection_radio_buttons :option_id, @question.options_array, :first, :last, {label: false} do |b| %>
<div class="col-sm-4">
<%= b.label(class: 'btn btn-large', style: 'margin-right: 20px; margin-left: 20px;') {b.radio_button(id: b.object.last, class: 'answer-input', style: 'display: none;') + b.text } %>
</div>
<% end %>
它正在正确生成 html,只是它生成了两个标签:
<span>
<label for="answer_option_id_15">
<div class="col-sm-4">
<label class="btn btn-large" for="answer_option_id_15" style="margin-right: 20px; margin-left: 20px;">
<input class="answer-input" id="Way too many" name="answer[option_id]" style="display: none;" type="radio" value="15" />
Way too many
</label>
</div>
</label>
</span>
由于某种原因,它正在生成第一个标签。我只想保留第二个。标签: false 不起作用。如何摆脱第一个标签?