Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 1.47 KB

README.rdoc

File metadata and controls

51 lines (30 loc) · 1.47 KB

JqueryNotifyBar

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

Installation

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

Usage

Rails 3.0

<%= include_jquery_notify_bar %>

Rails 3.1

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 %>

Parameters

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