Files
railsgoat/app/views/layouts/shared/_messages.html.erb
T
robbiepaul 298610b5f6
CI / test (3.4.1) (push) Has been cancelled
Initial commit (history cleared)
2026-04-29 11:21:39 +01:00

39 lines
909 B
Plaintext
Executable File

<% flash.each do |name, msg| %>
<% name = name.to_sym %>
<%
alert_class = case name
when :error, :alert
'alert-danger'
when :success, :notice
'alert-success'
when :info
'alert-info'
when :warning
'alert-warning'
else
'alert-secondary'
end
icon_class = case name
when :error, :alert
'bi-exclamation-circle-fill'
when :success, :notice
'bi-check-circle-fill'
when :info
'bi-info-circle-fill'
when :warning
'bi-exclamation-triangle-fill'
else
'bi-bell-fill'
end
%>
<div class="alert <%= alert_class %> alert-dismissible show d-flex align-items-center" role="alert">
<i class="bi <%= icon_class %> me-2"></i>
<div class="flex-grow-1">
<%= msg %>
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<% end %>