Skip to content

Commit b0ff245

Browse files
author
Paulo Mateus Moura da Silva
committed
Readme: Not raise error if params not defined in custom config
1 parent dcfc9c9 commit b0ff245

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]
52+
params[:page][:number] if params[:page]
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]
59+
params[:page][:size] if params[:page]
6060
end
6161

6262
# Optional: Include the total and last_page link header

0 commit comments

Comments
 (0)