Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set current page #73

Open
vovkats opened this issue Dec 10, 2016 · 1 comment
Open

Set current page #73

vovkats opened this issue Dec 10, 2016 · 1 comment

Comments

@vovkats
Copy link

vovkats commented Dec 10, 2016

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?

@davidcelis
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants