Invalid page number in URL causes no items to be displayed #294

Closed
ghost opened this Issue Feb 15, 2013 · 1 comment

Projects

None yet

1 participant

@ghost
ghost commented Feb 15, 2013

If I use pagination and manually change the page number query string parameter to a value less than 1 or greater than the total number of pages, no items are displayed. For example, if there are a total of 5 pages and I manually change the page number to 6, I expect to see the items for page 5. If I change it to -1, I expect to see the items for page 1. Is there any way i can get that?

Owner
mislav commented Feb 18, 2013

This isn't and won't be built into will_paginate.

You can call out_of_bounds? on a paginated collection to check if the page number is too large for the current number of items. For page: -1, you'll have to create a separate special condition in your app.

@mislav mislav closed this Feb 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment