hotwired / turbo-rails

Use Turbo in your Ruby on Rails app
https://turbo.hotwired.dev
MIT License
2.13k stars 329 forks source link

Keep flash in Turbo Frame requests #699

Closed p8 closed 2 weeks ago

p8 commented 2 weeks ago

A POST request can set the flash and return a redirect response. If a Turbo-Frame request that gets made before the redirect location gets called, the flash gets discared by the Turbo-Frame request.

By making sure a Turbo-Frame request keeps the flash, we can avoid this problem.

seanpdoyle commented 2 weeks ago

@jorgemanrubia @brunoprietog are either of you able to enable CI to execute for this PR?

p8 commented 2 weeks ago

Thanks @jorgemanrubia and @seanpdoyle !

brendon commented 1 week ago

Just wondering, but what if a turbo frame response renders the flash messages? Would this not then keep the messages and display them again (potentially) on another subsequent unrelated request?