github, Bootstrap 3 ( Rails 4, Rails 3.2).
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
//javascripts/application.js
My app/assets/stylesheets/application.css
/*
*= require dataTables/jquery.dataTables
*= require dataTables/jquery.dataTables.bootstrap3
*= require_tree .
*= require_self
*/
//javascripts/products.js.coffee
jQuery ->
$('#datatable_products').dataTable
sPaginationType: "bootstrap"
/views/products/index.html.erb
<table id="datatable_products" class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Price</th>
<th>Stock</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @products.each do |product| %>
<tr>
<td><%= product.name %></td>
<td><%= product.category %></td>
<td><%= product.price %></td>
<td><%= product.stock %></td>
<td><%= link_to 'Show', product %></td>
<td><%= link_to 'Edit', edit_product_path(product) %></td>
<td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %> </td>
</tr>
<% end %>
</tbody>
</table>
, thead tbody. Rails 4
<th colspan="3"></th>
.
, :
https://github.com/emilde92/datatablestore
http://www.datatables.net/manual/styling/bootstrap
http://getbootstrap.com/css/
http://railscasts.com/episodes/340-datatables