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:
@@ -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 %>
|
||||
|
||||
@@ -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 %>
|
||||
Reference in New Issue
Block a user