Skip to content

Instantly share code, notes, and snippets.

@tamouse
Created June 15, 2014 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamouse/9902e250495ad277d5d6 to your computer and use it in GitHub Desktop.
Save tamouse/9902e250495ad277d5d6 to your computer and use it in GitHub Desktop.
flash_class method for rails application helper
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