-
-
Save rchampourlier/2887844 to your computer and use it in GitHub Desktop.
Rails flash messages using Twitter bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- if flash | |
- flash.each do |level, message| | |
%div{:class => "alert #{flash_level(level)}"} | |
%button.close{:"data-dismiss" => 'alert'}= "×" | |
= message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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