Module: Growl::Rails::Helper

Defined in:
lib/growl/rails/helper.rb

Instance Method Summary collapse

Instance Method Details

#flash_notification_tagObject



5
6
7
8
9
10
11
12
# File 'lib/growl/rails/helper.rb', line 5

def flash_notification_tag
  jscript = []
  flash.each do |k,v|
    jscript.push "$.growl({ title: '#{k.to_s.humanize.titleize}', message: '#{v}', style: '#{k.to_s}' });"
  end

  javascript_tag jscript.join("\n")
end