Request: restore overflow: :last_page #823
n-studio
started this conversation in
Version 43
Replies: 1 comment 1 reply
-
|
I agree that a simple option would look more elegant in your app code, although less explicit. Unfortunately, the pagy code would be more complicated, harder to maintain and inelegant than the rescue in your app. About AJAX and turbo: since you redirect to the same page structure, they should be able to handle it transparently (i.e. no code changes required). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
overflow: :last_pagehas been removed and the replacement suggestion is to raise an error and redirect.There are some situations where redirection is not possible, in particular when using AJAX/Turbo. And the situation would often happen when updating limit.
The workaround is then:
Which is quite inelegant. I believe
@pagy, @records = pagy(query, limit: params[:limit], overflow: :last_page)is still relevant.Beta Was this translation helpful? Give feedback.
All reactions