Rails flash messages using Twitter bootstrap
module ApplicationHelper
def flash_class(level)
case level
when :notice then "info"
when :error then "error"
when :alert then "warning"
end
end
end
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>