From 1b7e387d31262aa81e867ea8ce1a637568dc0c30 Mon Sep 17 00:00:00 2001 From: Timur Kozmenko Date: Thu, 21 Feb 2013 19:28:49 +1100 Subject: [PATCH] Introduce ApplicationHelper#class_for_flash --- app/helpers/application_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..5ef95b8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,12 @@ module ApplicationHelper + def class_for_flash(name) + case name.to_s + when "notice" + "alert alert-info" + when "error" + "alert alert-error" + else + "alert" + end + end end