app/helpers/bootstrap_flash_helper.rb in bootstrap-sass-extras-0.0.4 vs app/helpers/bootstrap_flash_helper.rb in bootstrap-sass-extras-0.0.5
- old
+ new
@@ -1,8 +1,14 @@
module BootstrapFlashHelper
+ ALERT_TYPES = [:error, :info, :success, :warning]
+
def bootstrap_flash
output = ''
flash.each do |type, message|
+ next if message.blank?
+ type = :success if type == :notice
+ type = :error if type == :alert
+ next unless ALERT_TYPES.include?(type)
output += flash_container(type, message)
end
raw(output)
end