Kaminari if next page exists?
Asked Answered
L

1

5

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

Lipfert answered 13/8, 2014 at 3:16 Comment(0)
I
9

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.

Iamb answered 13/8, 2014 at 4:36 Comment(1)
what do I do for REST APIs?Miran

© 2022 - 2024 — McMap. All rights reserved.