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

turbo_stream helpers not capturing correctly #1137

Closed
boardfish opened this issue Nov 15, 2021 · 1 comment · Fixed by #1650
Closed

turbo_stream helpers not capturing correctly #1137

boardfish opened this issue Nov 15, 2021 · 1 comment · Fixed by #1650
Assignees

Comments

@boardfish
Copy link
Collaborator

I'm trying to update multiple parts of the page by rendering a component that uses multiple turbo_stream.update tags. This comes out mangled, with a subset of the expected HTML rendered followed by several empty turbo-stream tags. I'll put together a failing test case soon.

Steps to reproduce

  1. Create a component whose template renders turbo-stream tags using the helper provided by turbo-rails.
  2. Render this in a controller action as follows:
respond_to { |format| format.turbo_stream { render ExampleComponent.new } }

Expected behavior

The content given to each use of the turbo_stream.update helper should be rendered inside turbo-stream tags.

Actual behavior

Some content is captured and rendered before empty turbo-stream tags.

System configuration

Rails version: 7.0.0.alpha2

Ruby version: 2.7.4

Gem version: 2.40.0

@boardfish
Copy link
Collaborator Author

I think this could be resolved by using a single output buffer if we come to do it again. In the meantime, this might work since it's akin to rendering a component in a controller context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant