Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails Plugin: Site-wide notifications -- inspired by Railscasts (work in progress)
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
generators/site_notifications
lib
tasks
test
.gitignore
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

SiteNotifications
=================

This is still a plugin in development. Still needs a lot of work to do:
  - Properly set up the generator templates so a resource name can be specified
  - Default to ERB templates, optionally use haml templates (currently only haml)
  - Write tests
  - Add features:
    - periodical checking of notifications
    - specify auto-hide duration per notification instead of in the view
    - more
  


Example
=======

To make it work:

1. Run the site_notifications generator:
    ./script/generate site_notifications

2. Set some sort of permissions in the NotificationsController to limit create/update/delete actions
    or delete them and do that through script/console 
    
3. Include the notifications.js (needs effects.js and prototype.js) and notifications.css in your layout

4. call the notifications helper in your layout:
    # it's using haml, so you need haml installed
    = notifications(:slide => true, :auto_hide_after => 2)
    # the slide parameter is if you want it to snap or slide (using scriptaculous)
    # the auto_hide_after is.. well... it auto hides after 2 seconds or 
      # nil if you want it to only hide after clicking on it
    

Something went wrong with that request. Please try again.