Checkboxes only work on first page - Datatables, rails

后端 未结 3 695
别那么骄傲
别那么骄傲 2021-01-12 10:55

Senario: So basically I\'m using DataTables and have checkboxes on its first column. My DataTables have multiple pages (pagination).

The Pro

3条回答
  •  暖寄归人
    2021-01-12 11:31

    if you are using Rails what about using Form Helpers?

    If you are creating a new record, one simple example is:

    <%= form_for(:table_name, :action => 'create') do |f| %>
    
    
    <%= f.label(:responsive) %> <%= f.check_box(:responsive) %>
    <%= f.label(:auto_width) %> <%= f.check_box(:auto_width) %>
    <%= submit_tag("Create Page") %> <% end %>

    Even if you have several pages, if you keep all your form helpers inside the form_for method, everything should be saved to your database.

提交回复
热议问题