Nice writeup of using Datatables in Rails app. I use this gem myself in a CRM. Easy to use and looks great out of the box. I just wish it would work with mongodb 😦
You can learn more about data tables from its official website http://datatables.net . Here is a simple example of integrating data table in your rails app.
Add the gem in your gem file
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
Run the bundle install.
We can now set DataTables up with the asset pipeline.
In your application.js add the following line
//= require dataTables/jquery.dataTables
In your application.css add the following line
*= require dataTables/jquery.dataTables
Now we have installed the data table in the application.In order to display the data table effect in your listing page ,modify it like below
<table id="product_lists"> <thead> <tr> <th>Product Name</th> <th>Category</th> <th>Price</th> </tr>…
View original post 89 more words