Skip to content

Commit 010414c

Browse files
authored
Merge pull request #306 from senid231/291-improve-readme-pagination-override-example
#291 import README - pagination override examples
2 parents f97ce89 + 79fedec commit 010414c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
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)