Skip to content

Instantly share code, notes, and snippets.

@rusllonrails
Forked from potomak/_flash.html.erb
Created January 24, 2014 15:20
Show Gist options
  • Save rusllonrails/8599312 to your computer and use it in GitHub Desktop.
Save rusllonrails/8599312 to your computer and use it in GitHub Desktop.
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert-message <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
module ApplicationHelper
def flash_class(level)
case level
when :notice then "info"
when :error then "error"
when :alert then "warning"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment