Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails-api gem pagination

Is there a way to add JSON pagination using the rails-api gem API?

I want to be able to fetch the first 50 users, then on another call start at the 50th user and get 50 more.

Something like this: url.com/api/v1/users?start=50

like image 560
Luca Avatar asked Dec 05 '25 04:12

Luca


1 Answers

You can use Will Paginate, you can also specify how many item you want to show.

You can also follow Rails Cast tutorial on how to use will paginate

like image 181
Archie Reyes Avatar answered Dec 07 '25 20:12

Archie Reyes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!