Countless pagination includes the last page that was retrieved in Link headers #816
Replies: 4 comments 17 replies
-
Countless discovers the pages on the go. The pagy param with the
Why would you care about the value of a param that you don't even have to handle manually? |
Beta Was this translation helpful? Give feedback.
-
|
Good catch! The missing
|
Beta Was this translation helpful? Give feedback.
-
|
I had the same issue. At first I thought it was a bug, but then realize it was by design. I clean up my URLs with wrapper methods that remove the "+last" suffix. module PaginationHelper
def pagy_next_url(pagy)
clean_countless_url(pagy.page_url(:next))
end
def pagy_previous_url(pagy)
clean_countless_url(pagy.page_url(:previous))
end
private
# Remove the "+last" encoding from countless pagination URLs
# Converts ?page=3+3 to ?page=3
def clean_countless_url(url)
return nil if url.nil?
url.gsub(/page=(\d+)\+\d+/, 'page=\1')
end
end |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version 43 of pagy changes the way the Link headers look for countless pagination. Instead of just adding a
page=1param to the url, it adds something likepage=1+2.Why is this done, and is there any way to stop pagy from doing this?
I would prefer to have normal link headers that look the same way irregardless of whether I'm using countless pagination.
Beta Was this translation helpful? Give feedback.
All reactions