Skip to content

Commit

Permalink
Move flash messages inside main container in application layout
Browse files Browse the repository at this point in the history
  • Loading branch information
virolea committed Jan 4, 2024
1 parent 11d5d6e commit 42899cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 1 addition & 6 deletions app/views/layouts/panoptic/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@

<%= render "shared/navbar" %>

<% flash.each do |type, message| %>
<div class="alert alert-info mb-3" role="alert">
<%= message %>
</div>
<% end %>

<main class="container mt-2">
<%= render "shared/flashes" %>
<%= content_for?(:content) ? yield(:content) : yield %>
</main>

Expand Down
7 changes: 7 additions & 0 deletions app/views/shared/_flashes.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if flash[:notice] %>
<div class="alert alert-success" role="alert"><%= flash[:notice] %></div>
<% end %>

<% if flash[:alert] %>
<div class="alert alert-danger" role="alert"><%= flash[:alert] %></div>
<% end %>

0 comments on commit 42899cc

Please sign in to comment.