When I submit a form inside a frame, if the form has an error it’s OK, the frame is updated and all errors are displayed.
But when the controller return a redirect, how can I redirect the user or replace the “new_registration” frame by the content of the redirection response please?
<%= turbo_frame_tag 'new_registration' do %>
<%= form_with model: @user, url: sign_up_path, local: true do |form| %>
...
<% end %>
<% end %>
If you want only that part of the page to be updated, you need to wrap the response in a turbo frame with a corresponding ID (turbo_frame_tag 'new_registration').
If you want a full-page redirect (as in, the entire page gets replaced with the redirected page), add a target="_top" attribute to the frame (turbo_frame_tag 'new_registration', target: :_top).