Extract flash message into a partial, and wrap in a turbo frame

to prepare for turbo responses to set a flash message.
This commit is contained in:
Mike Dalessio
2025-08-07 13:49:02 -04:00
parent 99bf09139d
commit a8a8a46efa
2 changed files with 10 additions and 7 deletions
+1 -7
View File
@@ -8,13 +8,7 @@
<%= yield :header %>
</header>
<% if notice = flash[:notice] || flash[:alert] %>
<div class="flash" data-controller="element-removal" data-action="animationend->element-removal#remove">
<div class="flash__inner shadow">
<%= notice %>
</div>
</div>
<% end %>
<%= render "layouts/shared/flash" %>
<main id="main">
<%= yield %>
+9
View File
@@ -0,0 +1,9 @@
<%= turbo_frame_tag :flash do %>
<% if notice = flash[:notice] || flash[:alert] %>
<div class="flash" data-controller="element-removal" data-action="animationend->element-removal#remove">
<div class="flash__inner shadow">
<%= notice %>
</div>
</div>
<% end %>
<% end %>