Skip to content

Commit 79fedec

Browse files
committed
JsonApiClient#291 import README - pagination override examples
1 parent f97ce89 commit 79fedec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ You can customize how your resources find pagination information from the respon
493493
If the [existing paginator](https://github.com/chingor13/json_api_client/blob/master/lib/json_api_client/paginating/paginator.rb) fits your requirements but you don't use the default `page` and `per_page` params for pagination, you can customise the param keys as follows:
494494
495495
```ruby
496-
JsonApiClient::Paginating::Paginator.page_param = "page[number]"
497-
JsonApiClient::Paginating::Paginator.per_page_param = "page[size]"
496+
JsonApiClient::Paginating::Paginator.page_param = "number"
497+
JsonApiClient::Paginating::Paginator.per_page_param = "size"
498498
```
499499
500500
Please note that this is a global configuration, so library authors should create a custom paginator that inherits `JsonApiClient::Paginating::Paginator` and configure the custom paginator to avoid modifying global config.

0 commit comments

Comments
 (0)