Yes, there is a way to reload the entire page using Turbo Frames when the form submission is successful. You can add the data-turbo-action="replace"
attribute to the form
element to specify that the page should be replaced with the response from the form submission.
For example:
<turbo-frame id="my-frame">
<form action="/submit" method="POST" data-turbo-action="replace">
<!-- Form fields here -->
<button type="submit">Submit</button>
</form>
</turbo-frame>
When the user submits the form and the server returns a successful response, Turbo Frames will replace the contents of the my-frame
frame with the new HTML returned by the server, effectively reloading the entire page.
Note that this will only work if the response from the server includes the HTML for the entire page, including the <turbo-frame>
tags and any other necessary scripts and stylesheets.
Asked: 2022-07-17 11:00:00 +0000
Seen: 22 times
Last updated: Feb 26 '23