public
Description: Provides a helper to output flash messages as list items automagically
Homepage: http://www.brightbox.co.uk/
Clone URL: git://github.com/brightbox/flashing-rails.git
name age message
file Readme.md Mon Jun 15 03:18:46 -0700 2009 Updating install command [caius]
file init.rb Thu Dec 11 13:28:24 -0800 2008 Initial Import [caius]
directory lib/ Thu Dec 11 14:25:59 -0800 2008 Tidying up the HTML output. [caius]
Readme.md

Flashing Rails

Description

Adds a method to your views to output all flash messages.

Install

ruby script/plugin install git://github.com/brightbox/flashing-rails.git

Usage

Add flash_messages where you want the list to appear. It outputs an unordered list. Each list item has a class of the type of flash message added. See example below.

Optionally add :id => "foo" or :class => "bar" to set the id/class of the list in HTML. Default is an id of "Flash" with no class.

Example

Controller

flash[:notice] = "Hi people."
flash[:warning] = "I am warning you of impending doom."
flash[:error] = "You forgot to blink whilst reading this."

Layout

<%= flash_messages %>

Output

<ul id="flash">
    <li class="notice">Hi people.</li>
    <li class="warning">I am warning you of impending doom.</li>
    <li class="error">You forgot to blink whilst reading this.</li>
</ul>

Released under the MIT Licence

Copyright (c) 2008 Brightbox Systems Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

See http://www.brightbox.co.uk/ for contact details.