From 76918fff3ed8696b96154ffa90e6377a80764691 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 1 Aug 2024 21:34:25 -0400 Subject: [PATCH] Handle displaying notice/alert flashes --- app/assets/stylesheets/application.tailwind.css | 6 ++++++ app/views/layouts/application.html.erb | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 8666d2f..13dc3ef 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -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 { diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c90e132..5fd2ba6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,6 +22,14 @@ + <% if flash.any? %> + <% flash.each do |type, msg| %> +
+ <%= msg %> +
+ <% end %> + <% end %> +
<%= yield %>