Module: Platformx::NotifyHelpers
- Defined in:
- lib/platformx/notify.rb
Overview
Notification helpers
Instance Method Summary collapse
-
#x_notify(flash: "", timer: 4000, align: "right", from: "top") ⇒ String
Notify view helper.
Instance Method Details
#x_notify(flash: "", timer: 4000, align: "right", from: "top") ⇒ String
Notify view helper
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/platformx/notify.rb', line 13 def x_notify(flash: "", timer: 4000, align: "right", from:"top") color = "success" = "" if !flash[:success].nil? = flash[:success] color = "success" end if !flash[:notice].nil? = flash[:notice] color = "warning" end if !flash[:error].nil? = flash[:error] color = "danger" end unless == "" cb = <<EOS <script> $().ready(function(){$.notify({message: "#{}"},{type: "#{color}",timer: #{timer}, placement: {from: "#{from}",align: "#{align}"}});}); </script> EOS return cb end end |