What is the method in kaminari
to know if next page exists? With will_paginate
its simple you just call in next_page?
on model. I wonder if there is anything in kaminari
Add page(params[:page]) in front get data query in controller function. 4. Add <%= paginate @attribute %> in html view and it is done. Kaminari automatically handles each and everything for it.
will_paginate is a pagination library that integrates with Ruby on Rails, Sinatra, Hanami::View, Merb, DataMapper and Sequel. See installation instructions on the wiki for more info.
To check if there is a next page in the kaminari views, use current_page.next?
.
To query the @posts instead you can use @posts.next_page
which will return nil if there is not a next page or @posts.last_page?
which will be true if there is no next page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With