This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by austinmei5
Create 2 partials for notices and alerts:
<%= notice %>
<%= alert %>
We can also create a single partial and pass in the css_class:
<%= message %>
Logic in Application Layout:
<% if notice.present? %>
<%= render "shared/flash", message: notice, css_class: "success" %>
<% end %>
<% if alert.present? %>
<%= render "shared/flash", message: alert, css_class: "danger" %>
<% end %>
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by austinmei5
austinmei5 | Sciencx (2023-01-21T01:06:14+00:00) Notice and Alerts. Retrieved from https://www.scien.cx/2023/01/21/notice-and-alerts/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.