A simple controller that redirects to a path with a flash message works in a traditional rails app because usually there is a part in the app layout that renders flash messages.
However, when used with Turbo frames, flash messages are not shown during a frame controlled redirect as they are not part of the returning frame.
To fix this, I’ve wrapped my flash render view in a turbo frame called :notifications and in the action I use a turbo_stream.erb to send 2 streams down the client: one for the actions main response and a second one just to replace the :notifications frame, so the flash messages are shown.
Using this approach shows the flash message at the right time, but also repeats them on the next full refresh.
I was wondering if there is a “correct” way to deal with flash messages in Hotwire which I am completely missing out.