Frames: handle GET
form submissions
#449
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes 446.
When handling a
<form method="get" action="..." data-turbo-frame="...">
submission targeting a<turbo-frame>
element,responses that don't redirect do not change the element's
[src]
attribute.
Following the changes made in 424,
<form>
submissions that resultin
GET
requests are handled the same as other form submissions in thatthey fire
turbo:submit-start
andturbo:submit-end
events. What424 did not account for is navigations initiated by
<form method="get">
submissions that do not redirect.In response to those requests, this commit adds two additional criteria
for updating the
<turbo-frame src="...">
attribute:not indicate a server-side state change (for example, like a 201
Created with a
Location:
header might)Content-Type:
is HTML (not JSON or even Turbo Stream)Under those circumstances, the frame's
[src]
is updated.This commit adds test coverage for this new behavior along with
additional coverage to guard against regressions.