Created
April 22, 2015 17:01
-
-
Save patrickespake/2286298fa8936bc76f6e to your computer and use it in GitHub Desktop.
alert_helper.rb
This file contains hidden or 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 AlertHelper | |
# Define the necessary css class for each alert | |
def alert_class_for(flash_type) | |
case flash_type.to_sym | |
when :success | |
"alert-success" | |
when :error | |
"alert-danger" | |
when :alert | |
"alert-warning" | |
when :notice | |
"alert-info" | |
else | |
flash_type.to_s | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment