Module: HumaneRails::FlashMessagesHelper

Defined in:
app/helpers/humane_rails/flash_messages_helper.rb

Instance Method Summary collapse

Instance Method Details

#humane_flash_messagesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/humane_rails/flash_messages_helper.rb', line 3

def humane_flash_messages
  content = ""

  unless flash[:notice].blank?
    content << javascript_tag("humane.notice(\"#{escape_javascript(flash[:notice])}\");")
  end

  unless flash[:error].blank?
    content << javascript_tag("humane.error(\"#{escape_javascript(flash[:error])}\");")
  end

  unless flash[:alert].blank?
    content << javascript_tag("humane.alert(\"#{escape_javascript(flash[:alert])}\");")
  end

  content
end