README.rdoc in simple_datatables-0.1.6 vs README.rdoc in simple_datatables-0.1.7
- old
+ new
@@ -22,11 +22,11 @@
* Second is to prepare correct request on the client side
This gem provides interface for the second way.
To use it you should do the following easy three steps:
-Create simple meta_search and will_paginate controller action as usual and add ".datatables" format
+Create simple meta_search and will_paginate (optionally) controller action as usual and add ".datatables" format
respond_to :html, :datatables
def search
@products = Product.search(params[:search]).paginate(:page => params[:page], :per_page=>params[:per_page])
@@ -42,15 +42,25 @@
Create Jsonify view with column values for columns listed in aoColumns. See example for clarification.
This gem uses:
* meta_search for nice search and sort request syntax mapping
-* will_paginate for nice pagination request syntax mapping
* jsonify for simple output generation
+This gem provides integration with:
+* will_paginate for nice pagination request syntax mapping
+
Gem works only with rails 3.1.
Gem includes datatables library and fnSetFilteringDelay plugin so you haven't include it by yourself.
+
+== Pagination
+
+Simple_datatables is compatible with will_paginate. Datatables will provide you "page" and "per_page" request params.
+
+If you do not use pagination do not forget to save search result to some variable with meta_search relation method:
+
+ @products = Product.search(params[:search]).relation
== Search for all fields
Note that fulltext search will work only with text fields due to meta_search restrictions. To prevent errors use bSearchable: false for non-text columns in aoColumns field.