Skip to content

Instantly share code, notes, and snippets.

@xuncheng
Created July 15, 2013 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuncheng/5998767 to your computer and use it in GitHub Desktop.
Save xuncheng/5998767 to your computer and use it in GitHub Desktop.
Rails flash messages using bootstrap
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
<a class="close" data-dismiss="alert">&#215;</a>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
</div>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment