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

What are the controls effected before injecting text/vnd.turbo-stream.html? #634

Open
dvodvo opened this issue Jun 4, 2024 · 0 comments

Comments

@dvodvo
Copy link

dvodvo commented Jun 4, 2024

I have come across a situation where form_with is not being processed in the default manner as TURBO_STREAM, but as HTML, in other words, the header request.accept is not being injected with text/vnd.turbo-stream.html.

In a first instance of this erroneous processing, an attribute's name was the same as the name of a class (a different one) ; initially a has_many relationship had not been spcified in the class. Once the relationship was specified the form handling the attirbute would not process via TURBO_STREAM but revert to HTML. After changing the attribute name, processing reverted back to its expected default format. Thus a form of naming conflict impeded processing via turbo stream.

However, a second case has not been worked out as of yet (the above naming problem is apparently not in play).
The closest one could get is with
form_with url: ops_g_tables_path(format: 'turbo_stream')
will render an HTML tag with action="/ops/g_tables.turbo_stream"
and the launching of the form will be logged as
Processing by OpsController#g_tables as TURBO_STREAM
but that's a hack, as the browser header is still set to
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
and the result is a simple text rendering of the file in the view folder.

Clearly the application is doing something that is tripping up the request header setting process... the proof is in the first case.

What other controls are effected before the text/vnd... injection occurs, so we can track this down?

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

No branches or pull requests

1 participant