-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
When I configure custom parameters for library I get incorrect links for headers.
For example,
ApiPagination.configure do |config|
...
# If you have more than one gem included, you can choose a paginator.
config.paginator = :pagy # or :will_paginate
# Optional: what parameter should be used to set the page option
config.page_param do |params|
params[:page][:number] if params[:page].is_a?(ActionController::Parameters)
end
# Optional: what parameter should be used to set the per page option
config.per_page_param do |params|
params[:page][:size] if params[:page].is_a?(ActionController::Parameters)
end
...
end
Some response,
Link →<http://localhost:3000/api/reviews?page=1>; rel="first", <http://localhost:3000/api/reviews?page=2>; rel="prev", <http://localhost:3000/api/reviews?page=5>; rel="last", <http://localhost:3000/api/reviews?page=4>; rel="next"
X-Per-Page →20
X-Page →3
X-Total →86
Maybe is it hardcode?
Metadata
Metadata
Assignees
Labels
No labels