Sha256: 51446806d1fc181950c828e890092bc79cf3aacc8982f020c5a45f71767a21ca
Contents?: true
Size: 566 Bytes
Versions: 11
Compression:
Stored size: 566 Bytes
Contents
module GroundworkFlashHelper ALERT_TYPES = [:error, :success, :warning] def groundwork_flash flash_messages = [] 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) Array(message).each do |msg| text = content_tag(:p, msg.html_safe, :class => "message #{type}") flash_messages << text if message end end flash_messages.join("\n").html_safe end end
Version data entries
11 entries across 11 versions & 1 rubygems