8000 Fix Readme: custom per_page · davidcelis/api-pagination@fb2bf24 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit fb2bf24

Browse files
author
Paulo Mateus Moura da Silva
committed
Fix Readme: custom per_page
1 pa
8000
rent 8a51167 commit fb2bf24

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
@@ -49,14 +49,14 @@ ApiPagination.configure do |config|
4949
config.page_param = :page
5050
# or
5151
config.page_param do |params|
52-
params[:page][:number] if params[:page].is_a?(Hash)
52+
params[:page][:number] if params[:page].is_a?(ActionController::Parameters)
5353
end
5454

5555
# Optional: what parameter should be used to set the per page option
5656
config.per_page_param = :per_page
5757
# or
5858
config.per_page_param do |params|
59-
params[:page][:size] if params[:page].is_a?(Hash)
59+
params[:page][:size] if params[:page].is_a?(ActionController::Parameters)
6060
end
6161

6262
# Optional: Include the total and last_page link header

0 commit comments

Comments
 (0)
0