To check if the next page is in kaminari views use current_page.next?
.
To query @posts, you can use @posts.next_page
which will return nil if there is no next page on the next page, or @posts.last_page?
which will be false if there is no next page.
source
to share