Skip to content

Instantly share code, notes, and snippets.

@patrickespake
Created April 22, 2015 17:01
Show Gist options
  • Save patrickespake/2286298fa8936bc76f6e to your computer and use it in GitHub Desktop.
Save patrickespake/2286298fa8936bc76f6e to your computer and use it in GitHub Desktop.
alert_helper.rb
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