Bounga / Flash Helper (http://bitbucket.org/Bounga/flash-helper/)
Ruby on Rails helper that simplify flash messages displaying
$ hg clone http://bitbucket.org/Bounga/flash-helper/
Flash Helper
This extension provides a simple way to handle flash messages. You can easily display notices, errors and warnings using the convinience method.
Installation
In your Rails app root, use the following command-line :
1 2 |
or install it system-wide :
1 |
and require it in Rails::Initializer (environment.rb) :
1 |
Use included CSS
If you want to install the flash_helper CSS file in your stylesheets directory, use :
1 |
And then in your layout use :
1 |
Example
For example, in your layout use :
1 |
Then in your controllers you can use :
1 2 3 4 |
If you're using Rails >= 2.2, you can translate plugin internal messages. For example in config/locales/fr.yml you can add :
1 2 |
Tune display_flashes :
Options for flash helpers are optional and get their default values from the Bounga::FlashHelper::ViewHelpers.flash_options hash. You can write to this hash to override default options on the global level:
1 |
Available options (and their defaults) are :
1 2 3 4 5 |
By putting this into "config/initializers/flash_helper.rb" (or simply environment.rb in older versions of Rails) you can easily override any default option.
Other
If you want to contribute you should take a look at:
You can take a look at RDoc too.
Problems, comments, and suggestions are welcome on the ticket system.
Copyright (c) 2008 Nicolas Cavigneaux, released under the MIT license
This revision is from 2008-12-10 16:51
