module FlashHelper DEFAULT_MAPPING = { :notice => :info, :alert => :danger, :error => :danger, } def flash_messages messages = flash.map do |type, message| content_tag(:div, message, class: "alert alert-#{DEFAULT_MAPPING[type.to_sym] || type}", role: "alert") end safe_join(messages, "\n") end end