Handle displaying notice/alert flashes
This commit is contained in:
parent
a3a09e845f
commit
76918fff3e
2 changed files with 14 additions and 0 deletions
|
@ -2,6 +2,12 @@
|
|||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.msg-notice {
|
||||
@apply bg-green-300 text-green-900;
|
||||
}
|
||||
.msg-alert {
|
||||
@apply bg-red-300 text-red-900;
|
||||
}
|
||||
/*
|
||||
|
||||
@layer components {
|
||||
|
|
|
@ -22,6 +22,14 @@
|
|||
</ul>
|
||||
</nav>
|
||||
|
||||
<% if flash.any? %>
|
||||
<% flash.each do |type, msg| %>
|
||||
<div class="py-2 px-4 font-bold msg-<%= type %>">
|
||||
<%= msg %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<main class="container mx-auto mt-28 px-5 flex">
|
||||
<%= yield %>
|
||||
</main>
|
||||
|
|
Loading…
Reference in a new issue