From 341eea72e3d49b647b55ff8debf1115ededd0ac7 Mon Sep 17 00:00:00 2001 From: Grzegorz Brzezinka Date: Tue, 3 Feb 2015 11:08:41 +0100 Subject: [PATCH] Call to_s on msg before making it html_safe Sometimes messages are passed as symbols - then it is reasonable to stringify them before html_safe, otherwise it throws an error. --- app/helpers/bootstrap_flash_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/bootstrap_flash_helper.rb b/app/helpers/bootstrap_flash_helper.rb index 08d1fda8..1dbe6412 100644 --- a/app/helpers/bootstrap_flash_helper.rb +++ b/app/helpers/bootstrap_flash_helper.rb @@ -16,7 +16,7 @@ def bootstrap_flash(options = {}) Array(message).each do |msg| text = content_tag(:div, content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") + - msg.html_safe, :class => "alert fade in alert-#{type} #{options[:class]}") + msg.to_s.html_safe, :class => "alert fade in alert-#{type} #{options[:class]}") flash_messages << text if msg end end