Rails, ActiveResource, and Pagination

What is the best way to implement pagination in a REST API so that the ActiveResource client can easily navigate paginated pages? There were some suggestions, like here and here , but being new to ActiveResource, I wonder if there is a better way.

+4
source share
3 answers

I did this with kaminari and some patch for activeresource, here is a stone with an example https://github.com/Fivell/activeresource-response

+1
source

I have not yet had the opportunity to delve into this for a project, but this Will_Paginate fork may come in handy. It adds support for the paginate method to ActiveResource.

0
source

We released a gem built by us on the basis of material in production in a rather high Rails traffic application. It allows you to transparently split pages by adding current_page, per_page and total_entries as attributes of the root node of a serialized XML collection (and very fast if you use LibXML or Nokogiri, which I highly recommend the default REXML).

Here's a link to the GitHub project for PoxPaginate .

0
source

All Articles