An Interest In:
Web News this Week
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
January 21, 2023 01:06 am GMT
Original Link: https://dev.to/austinmei5/notice-and-alerts-35p6
Notice and Alerts
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 %>
Original Link: https://dev.to/austinmei5/notice-and-alerts-35p6
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To