Skip to content

Instantly share code, notes, and snippets.

@rchampourlier
Forked from potomak/_flash.html.erb
Created June 7, 2012 09:27
Show Gist options
  • Save rchampourlier/2887844 to your computer and use it in GitHub Desktop.
Save rchampourlier/2887844 to your computer and use it in GitHub Desktop.
Rails flash messages using Twitter bootstrap
- if flash
- flash.each do |level, message|
%div{:class => "alert #{flash_level(level)}"}
%button.close{:"data-dismiss" => 'alert'}= "×"
= message
module ApplicationHelper
def flash_level(level)
case level
when :notice then "alert-info"
when :error then "alert-error"
when :alert then ""
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment