Created
June 15, 2014 02:24
-
-
Save tamouse/9902e250495ad277d5d6 to your computer and use it in GitHub Desktop.
flash_class method for rails application helper
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
def flash_class(level) | |
class_level = case level.to_sym | |
when :success then "success" | |
when :error then "danger" | |
when :alert then "warning" | |
else 'info' | |
end | |
"alert alert-#{class_level}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment