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

TypeError: String can't be coerced into Fixnum #35

Closed
claudioStahl opened this issue Aug 31, 2016 · 0 comments
Closed

TypeError: String can't be coerced into Fixnum #35

claudioStahl opened this issue Aug 31, 2016 · 0 comments

Comments

@claudioStahl
Copy link

When I use offset in my request with a big data, I have this error:

TypeError: String can't be coerced into Fixnum

Look this trace:

kaminari (0.16.3) lib/kaminari/models/page_scope_methods.rb:23:in `-'
kaminari (0.16.3) lib/kaminari/models/page_scope_methods.rb:23:in `total_pages'
grape-kaminari (0.1.9) lib/grape/kaminari.rb:14:in `block in paginate'
grape-kaminari (0.1.9) lib/grape/kaminari.rb:12:in `tap'
grape-kaminari (0.1.9) lib/grape/kaminari.rb:12:in `paginate'
app/api/development/publication/categories_api.rb:37:in `block (4 levels) in <class:CategoriesAPI>'

I think that can fix:

collection.page(params[:page].to_i).per(params[:per_page].to_i).padding(params[:offset].to_i).tap do |data|
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

1 participant