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 %>
Total
2
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Software Architecture Patterns: Space-based Architecture

Next Post
what-is-a-core-update?-–-whiteboard-friday

What Is a Core Update? – Whiteboard Friday

Related Posts