Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set format turbo_stream in next_page_url helper #1126

Open
glaucocustodio opened this issue May 29, 2024 · 0 comments
Open

Unable to set format turbo_stream in next_page_url helper #1126

glaucocustodio opened this issue May 29, 2024 · 0 comments

Comments

@glaucocustodio
Copy link

next_page_url ignores the format options:

# controller
@users = User.all.page(params[:page])

# view
next_page_url(@users, format: :turbo_stream)
# actual: /users?page=2
# expected: /users.turbo_stream?page=2

Having that could be relevant for infinite pagination powered by Hotwire, eg:

  • first request is format=HTML, user sees first X records
  • when user scrolls a turbo frame is loaded firing a format=TURBO_STREAM request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant