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">
请提供其他方法