So the best solution that I have found was this. Do not use turbo_frame_tag. The redirect process is not working the way it should. Meaning, when you redirect it should redirect to the new page, that’s the intent of that command.
Right Turbo, on redirect, tries to replace a turbo_frame_tag that it came from. And if it doesn’t find it after it processes HTML from redirected page, it fails to “redirect” to the new page. Maybe, the solution should be this: if frame_tag is present, replace it, if not replace the whole page.
For now, here’s the workaround that works best:
Instead of using turbo_frame_tag. create a new.turbo_stream.erb file for your form.
Wrap your form into a div with id. And use turbostream to replace that part of the page.
_form.html.erb
<%= tag.div "new_board_form" do %>
<%= form_with board, url: new_board_path do %>
<% end %>
<% end %>
new.turbo_stream.erb ← to render errors
<%= turbo_stream.replace "new_board_form" do %>
<%= render "form", board: @new_board %>
<% end %>
And then simple redirect on successful form completion
boards_controller.rb
if @new_board.save
redirect_to board_path (@new_board) }
else
render :new
end