Skip to content

last? should return true if page is out of range #366

Closed
wants to merge 1 commit into from

3 participants

@moiristo

Like in /lib/kaminari/models/page_scope_methods.rb#last_page? (l48),
last? should return true if the page is out of range. This prevents that
the paginator keeps rendering 'Next page' links when a page is requested
that is out of range.

@moiristo moiristo last? should return true if page is out of range
Like in /lib/kaminari/models/page_scope_methods.rb#last_page? (l48), 
last? should return true if the page is out of range. This prevents that
the paginator keeps rendering 'Next page' links when a page is requested
that is out of range.
4d9c8dc
@yuki24
Collaborator
yuki24 commented Apr 1, 2013

I think #last? should return false if the page is out of range. However, we also want #out_of_range? method to know if the page is out range.

@yuki24 yuki24 added a commit that closed this pull request Jun 18, 2013
@yuki24 yuki24 Add #out_of_range? method
closes #306, and closes #366
8e48e45
@yuki24 yuki24 closed this in 8e48e45 Jun 18, 2013
@brandonjmckay

So does this mean the link_to_next_page method should now recognize when the next page is out of range?

I'm using kaminari 0.15.1 and I'm having this same problem with the link_to_next_page helper. Creates a link to the next page when there shouldn't be.

@yuki24
Collaborator
yuki24 commented Feb 7, 2014

@brandonjmckay that sounds like a bug. Could you create a new issue?

@brandonjmckay

Sure, I'll post my hacky fix too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.