我正在使用SimpleForm 3.2.1與Rails 4.我試圖將一個鋼軌形式轉換爲simple_form。這是與普通軌道形式單選按鈕的工作原理代碼:個人simple_form單選按鈕
<ul class="list-radios list-multiplier">
<% @organization_plans.each_with_index do |plan, index| %>
<li>
<div class="radio custom-radio">
<%= f.radio_button :plan_id, plan.id, id: "field-rad#{index}", data: {price: plan.total_price} %>
<label class="form-label" for='field-rad<%= index %>'>
<span></span>
<%= plan.description %>
</label>
</div><!-- /.radio -->
</li>
<% end %>
</ul><!-- /.list-radios -->
我試圖將它與下面的代碼SimpleForm:
<ul class="list-radios list-multiplier">
<% @organization_plans.each_with_index do |plan, index| %>
<li>
<div class="radio custom-radio">
<%= f.input :plan_id, value: plan.id, input_html: {id: "field-rad#{index}"}, data: {price: plan.total_price}, label: false, as: :radio %>
<label class="form-label" for='field-rad<%= index %>'>
<span></span>
<%= plan.description %>
</label>
</div><!-- /.radio -->
</li>
<% end %>
</ul><!-- /.list-radios -->
然而,當我在打開網頁瀏覽器我得到的錯誤:
No input found for radio
如何獲得這種形式開始與simple_form工作?