This is a simple ruby gem to include jquery.nofityBar from Dmitri Smirnov to your rails app.
jquery.notifyBar is a twitter like notification bar.
With this gem, all your flash messages will be showed in the nofity bar. Visit the demo page on Dmitri’s website
In your gem file add:
gem 'jquery_notify_bar'
You need copy this files to your stylesheets and javascripts folder
https://github.com/ustrajunior/jquery_notify_bar/blob/master/public/javascripts/jquery.notifyBar.js https://github.com/ustrajunior/jquery_notify_bar/blob/master/public/stylesheets/jquery.notifyBar.css
<%= include_jquery_notify_bar %>
In rails 3.1 you don’t need include the helper.
This helper is to include the js function to generate the notification.
<% flash.each do |key, msg| %> <%= jquery_notify_bar(key, msg) %> <% end %>
You can pass options too:
:cls => :success :animation_speed => 'normal' :delay => 2000
or all at the same time
<% flash.each do |key, msg| %> <%= jquery_notify_bar(key, msg, :cls => :success, :animation_speed => 'normal', :delay => 2000) %> <% end %>
This gem was inspired in the notify_bar by İ. Emre Kutlu
Copyright © 2011 Jose Carlos Ustra Junior, released under the MIT license