Sha256: cd8c4d914ddd526d60bc661010f73af37471bd6d52002f6cad39db6761199486

Contents?: true

Size: 403 Bytes

Versions: 10

Compression:

Stored size: 403 Bytes

Contents

module Tenon
  module FlashHelper
    def flash_messages
      messages = []
      %w(notice alert warning error).each do |msg|
        unless flash[msg.to_sym].blank?
          content = content_tag(:div, flash[msg.to_sym], class: 'flash__message')
          messages << content_tag(:div, content, class: "flash flash--#{msg}")
        end
      end
      messages.join('').html_safe
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tenon-2.1.0 app/helpers/tenon/flash_helper.rb
tenon-2.0.8 app/helpers/tenon/flash_helper.rb
tenon-2.0.7 app/helpers/tenon/flash_helper.rb
tenon-2.0.6 app/helpers/tenon/flash_helper.rb
tenon-2.0.5 app/helpers/tenon/flash_helper.rb
tenon-2.0.4 app/helpers/tenon/flash_helper.rb
tenon-2.0.3 app/helpers/tenon/flash_helper.rb
tenon-2.0.2 app/helpers/tenon/flash_helper.rb
tenon-2.0.1 app/helpers/tenon/flash_helper.rb
tenon-2.0.0 app/helpers/tenon/flash_helper.rb