I am successfully using the jquery-datatables-rails gem with twitter bootstrap. Using bootstraps requires using:
sPaginationType: "bootstrap"
in the datatable jquery function. All is good.
By default the bootstrap pagination looks like this:
<- previous 1 2 3 4 5 next ->
Is there a way to limit the number of pages created by the bootstrap pagination? For instance, so it looks like this?:
<- previous 1 2 3 next ->
The number of displayed pages is hardcoded in sample code given by dataTables (and in the jquery-datatables-rails gem).
I submitted a pull-request to use the same behavior as “full_numbers” pagination.
When this pull-request will be merged, you will just have to initialize your datatables like that: