Skip to content

jeffleeismyhero/active-resource-pagination

 
 

Repository files navigation

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,
  "total_entries": 5,
  "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})

About

Pagination support for ActiveResource

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%