Rails表单提交不触发

时间:2018-10-25 20:52:59

标签: ruby-on-rails submit

尝试创建一个表,该表将显示用户搜索的结果,从而允许用户将所需结果添加到数据库表中。

当我第一次创建并测试提交按钮时,它被禁用,因此我在提交操作中添加了disable_with: false。但是它仍然没有触发。

我忽略了什么?

<tbody>
    <% @stock_items.each do |stock| %>
      <tr>
        <td><%= stock.product_code %></td>
        <td><%= stock.desc1.titleize %></td>
        <td class="text-right"><%= stock.uoi %></td>
        <td class="text-right"><%= strip_trailing_zero(stock.qty_free) %></td>
        <td class="text-right"><%= number_to_gbp(stock.price)%></td>
        <td class="text-right"><%= number_to_percentage(((stock.price-stock.cost_sop)/stock.price)*100,precision: 0)%></td>
        <%= form_tag new_customer_opportunity_sop_header_sop_detail_path(@customer,@opportunity, @sop_header) do %>
        <td><%= hidden_field_tag 'stock_id', stock.id %>
          <%= submit_tag 'Add', data: { disable_with: false } %></td>
        <% end %>
       </tr>
    <% end %>
  </tbody>

0 个答案:

没有答案
相关问题