From ae1f1236a2626b7c694d69c86399e8bb97214231 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Wed, 23 Jan 2013 11:07:40 +0000 Subject: [PATCH] Add a pagination header [ci skip] --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dff9497..f1dc9f6 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ end Draper infers the decorator used for each item from the name of the collection decorator (`ArticlesDecorator` implies `ArticleDecorator`). If that fails, it falls back to using each item's `decorate` method. Alternatively, you can specify a decorator by overriding the collection decorator's `decorator_class` method. +#### Using pagination + Some pagination gems add methods to `ActiveRecord::Relation`. For example, [Kaminari](https://github.com/amatsuda/kaminari)'s `paginate` helper method requires the collection to implement `current_page`, `total_pages`, and `limit_value`. To expose these on a collection decorator, you can delegate to the `source`: ```ruby