No commit activity in last 3 years
No release in over 3 years
Basic pagination support for ActiveResource
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

active-resource-pagination Build status

Pagination support for ActiveResource

Usage

class Posts < ActiveResource::Base
  include ActiveResource::Pagination

  ...
end

This will add a JSON decoder that intercepts any response with the format:

{
  "total_pages": 5,
  "current_page": 1,
  "posts": [{
    "id": 1
  }]
}

This should work well with will_paginate style pagination on the controller, typically like this:

posts = Post.all(:params => {:per_page => 5, :page => 1})