繁体   English   中英

使用form_with代替form_tag面向单选按钮,合并问题栏5

[英]using form_with in place of form_tag facing for radio button the merge issue rails 5

form_with可以代替form_for和form_tag一起使用,因此会出现以下错误:

<div class="container">
  <%= render "shared/breadcrumb" %>
  <%= render "shared/back_button" %>
  <h2>Plotting</h2>
  <div id="data_conversion_request">
    <h4 class="text-center">Please select an option from below</h4>
    <%= form_with url: plotting_services_path do |form| %>
      <div class="row">
        <div class="col-md-5">
          FedEx Plotting (Plot to Asia) (Why use FedEx Asia plotting)
        </div>
        <div class="col-md-5">
          <%= form.radio_button('plotting','category', 'fed_ex_Plotting') %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-5">
          FedEx Office Plotting through DocStore
        </div>
        <div class="col-md-5">
          <%= form.radio_button('plotting','category', 'fedex_office_plotting') %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-5">
          TUKAcenter Plotting
        </div>
        <div class="col-md-5">
          <%= form.radio_button('plotting', 'category','tukacenter_plotting') %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-5">
        </div>
        <div class="col-md-5">
          <%= form.submit 'Select', class: 'btm btn-primary' %>
        </div>
      </div>

  <% end %>
  </div>
</div>
</div>

错误:

ActionView::Template::Error (undefined method `merge' for "fed_ex_Plotting":String):
    10:           FedEx Plotting (Plot to Asia) (Why use FedEx Asia plotting)
    11:         </div>
    12:         <div class="col-md-5">
    13:           <%= form.radio_button('plotting','category', 'fed_ex_Plotting') %>
    14:         </div>
    15:       </div>
    16:       <div class="row">

请提供是否还有其他方法

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM