Module: Interage::FlashMessageHelper

Included in:
ApplicationHelper
Defined in:
lib/interage/flash_message_helper.rb

Instance Method Summary collapse

Instance Method Details

#flash_messagesObject



5
6
7
8
9
10
11
# File 'lib/interage/flash_message_helper.rb', line 5

def flash_messages
  messages ||= flashes.map do |type, message|
    bootstrap_alert(handle_type(type), message)
  end

  safe_join(messages || [])
end

#flashesObject



13
14
15
# File 'lib/interage/flash_message_helper.rb', line 13

def flashes
  flash.to_h.symbolize_keys
end

#handle_type(type) ⇒ Object



17
18
19
# File 'lib/interage/flash_message_helper.rb', line 17

def handle_type(type)
  type == :notice ? :success : type
end