Skip to content

Set flash message immediately when turbo stream format#251

Open
joelzwarrington wants to merge 1 commit intoheartcombo:mainfrom
joelzwarrington:patch-1
Open

Set flash message immediately when turbo stream format#251
joelzwarrington wants to merge 1 commit intoheartcombo:mainfrom
joelzwarrington:patch-1

Conversation

@joelzwarrington
Copy link
Copy Markdown

When responding to a turbo_stream format, the flash should be displayed immediately as turbo streams are rendered in the same request.

When not displaying the flash message immediately, one would see the flash on a subsequent request.

When implementing the turbo stream, a developer would still need to render the flash themselves using something like this (or some partial):

<%= turbo_stream.prepend :flashes do %>
    <% flash.each do |type, message| %>
      <%= type %>: <%= message %>
    <% end %>
<% end %>

<%# ... other turbo stream actions %>

@joelzwarrington
Copy link
Copy Markdown
Author

Hi @carlosantoniodasilva 👋 would you mind having a look at this? 🙇

Copy link
Copy Markdown
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joelzwarrington thanks for the PR.

I'm looking into this, and also working on a test, but it looks like there's more to Turbo we need to handle to work with it correctly out of the box: #230.

It might take a bit to get it sorted out, but I want to get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants