From b064a89de3e8ec5229c68643901dc26f4238dc50 Mon Sep 17 00:00:00 2001 From: Teng-hao Chang Date: Tue, 30 Sep 2014 12:06:00 +0800 Subject: [PATCH] Map alert style with Devise flash --- lib/bootstrap_helper/helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap_helper/helper.rb b/lib/bootstrap_helper/helper.rb index 6d45df2..6e863b4 100644 --- a/lib/bootstrap_helper/helper.rb +++ b/lib/bootstrap_helper/helper.rb @@ -30,8 +30,8 @@ def render_body_tag def notice_message flash_messages = [] flash.each do |type, message| - type = :success if type == :notice - type = :danger if type == :alert + type = :success if type.to_sym == :notice + type = :danger if type.to_sym == :alert text = content_tag(:div, link_to("x", "#", :class => "close", "data-dismiss" => "alert") + message, :class => "alert fade in alert-#{type}") flash_messages << text if message end