From 9e54dc4372aa2e3dc9d580f7a51b871afba3aa49 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 27 Jan 2021 13:17:15 -0800 Subject: [PATCH] Describe JSONAPI_PAGE_SIZE constant Explain how to return page with more than 30 items when using pagination (see #24). --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index fe94452..d0011d9 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,17 @@ If you want to change the default number of items per page, use the 30 end ``` + +If you want to increase the maximum items per page to more than 30 (default) you have to set the constant `JSONAPI_PAGE_SIZE` in your controller: + +```ruby +class MyController < ActionController::Base + include JSONAPI::Pagination + + JSONAPI_PAGE_SIZE = 50 +end +``` + ### Deserialization `JSONAPI::Deserialization` provides a helper to transform a `JSONAPI` document