Delete multiple item by checkbox

前端 未结 1 407
感情败类
感情败类 2021-01-03 01:34

I want have this ability to select multiple items with checkboxes and delete them in one place.

This is the code:

<% @products.each do |p| %>
&         


        
相关标签:
1条回答
  • 2021-01-03 01:38

    1: You can create your own Ids by passing them as part of the options hash:

    <%= check_box_tag "product_ids[]", product.id, false, :id => "product_#{product.id}" %>
    

    For 2 and 3 I'd recommend looking at this Railscast.

    0 讨论(0)
提交回复
热议问题