Showing pagination links based on total number of records

325 views Asked by At

So i am using rails and want to proceed with either will_paginate or kaminari for pagination. Here is my below requirement.

  • I have lets say 900 records and want to show 10 records per page. So in total i want to show 90 links in pagination like >. So just based on records count i want to perform this.

So my question is, Though i have overall 900 records, my end point only gives me 10 records at the start. But I want to show links for 900 records (10 records per page). Using pagination later i want to load dynamically whenever user has clicked random page.

1

There are 1 answers

0
Pardeep Saini On BEST ANSWER

I go with Ojash answer. you can use kaminari and specify the window.

<%= paginate @users, :outer_window => 3 %>