api-pagination icon indicating copy to clipboard operation
api-pagination copied to clipboard

Set current page

Open vovkats opened this issue 8 years ago • 1 comments

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?

vovkats avatar Dec 10 '16 08:12 vovkats

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?

davidcelis avatar Dec 12 '16 22:12 davidcelis