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

is Kaminari.paginate_array necessary? #105

Closed
benfoxall opened this issue Mar 4, 2014 · 1 comment
Closed

is Kaminari.paginate_array necessary? #105

benfoxall opened this issue Mar 4, 2014 · 1 comment

Comments

@benfoxall
Copy link
Contributor

I just came across this in the schemas_controller:

schemas = Schema.all
@schemas = Kaminari.paginate_array(schemas).page(params[:page])

I think paginate_array is for when you have a simple array object, with a AR query I think you could have

@schemas = Schema.all.page params[:page]

Which would have the advantage of calling limit/skip on the Schema query rather than bringing in all the items each time.

@pezholio
Copy link
Contributor

pezholio commented Mar 4, 2014

I think this is because we're using Mongoid, and I couldn't find any suitable pagination solutions for Mongoid.

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