这是我的桌子:
index.html.erb:
<center><table border="1" cellspacing="0" cellpadding="10" id="c"></center>
<h3><center>List Of Products</h3></center>
<tr>
<th>S.No</th>
<th>Products</th>
<th>Availble Quantity</th>
<th>Price(each per kg/qua)</th>
<th>Quantity Requried<br>(enter required qua as per kg/qua)</br></th>
</tr >
<% @product.each do |product| %>
<tr>
<td><center><%= product.id %></center></td>
<td><center><%= check_box_tag "name" %> <%= product.name %></center></td>
<td><center><%=product.quantity %></center></td>
<td><center><%= product.price %></center></td>
<td><center><input type= "text" style="width:50px;"></center></td>
</tr>
<% end %>
</table><br><br>
<%= link_to "ADD",checkout_index_path, class: "btn btn-small btn-primary" %>
我的问题是,如果我选择任何复选框,它应该在下一页显示所选字段(即:index.html.erb/checkout)
我的 index.html.erb/checkout 页面:
<p id="notice"><%= notice %></p>
<h5>Slected products are:</h5>
<%= link_to 'Continue Online Shopping', products_path %>
例如,如果我选择项目 1 并单击添加按钮,它应该在结帐页面中显示所选项目。帮我!!!!!
所选项目应显示在此 index.html.erb/checkout 页面中