api-pagination
api-pagination copied to clipboard
Set current page
This is my config of pagination:
config.page_param do |params|
params[:page][:number]
end
config.per_page_param do |params|
params[:page][:size]
end
I have 40 records. I want to get record beginning with id 11. When I pass pages parameters : page: {number: 2, per_page: 10} I have got records beginning with id: 1
paginate json: users, per_page: params[:page][:size], page: params[:page][:number]
What am I doing wrong?
If you're specifying the param names in your configuration, you should only have to call paginate json: users. Can you try removing the other arguments and seeing if that works?