erw08g
Last Updated: July 09, 2016
·
327
· yeasayer
Fea31b1c45361c5a34c7d2e2bbb2a9ab

Integrate Rails flash alert/notice messages into Bootstrap 3 dismissible alert

<% unless flash.blank? %>
<div class='row'>
  <div class='col-sm-12'>
    <div id='flash'>
      <% flash.each do |key, value| %>
        <div class='flash alert alert-dismissible fade in alert-<%= key == 'notice' ? 'info' : 'danger' %>'>
          <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
            <span aria-hidden='true'>&times;</span>
          </button>
          <%= value %>
        </div>
      <% end %>
    </div>
  </div>
</div>
<% end %>
Say Thanks
Respond