Happyerrorsnotices

A simple ready made notices and errors implementation for use within coffeescript or rails

Installation

Add this line to your application's Gemfile:

gem 'happyerrorsnotices'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install happyerrorsnotices

Usage

in application.js you need:

//=require errors
//=require notices

in application.css you need to include

*=require errors
*=require notices

And include this partial in your view:

= render partial: 'layouts/errorsnotices'

From within a coffeescript file you can show a notice/error like this:

n = new Notices
n.setMessage "This is a notice!"
n.show()

e = new Errors
e.setErrorMessage "Error message!"
e.show()

Also the flash[:error] and flash[:notice] messages from your controllers will be shown the same way

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request