Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Cacheable Flash

Cacheable Flash

Installation ruby script/plugin install svn://rubyforge.org/var/svn/pivotalrb/cacheable_flash/trunk Description

This plugin enables greater levels of page caching by rendering flash messages from a cookie using JavaScript, instead of in your Rails view template. Flash contents are converted to JSON and placed in a cookie by an after_filter in a controller.

=== Usage

To use, include the CacheableFlash module in your controller. It’s all or none on the actions in your controller, so you can’t mix JS and HTML display of your flash message in a controller. No other modifications to the controller are needed. You will need to add divs and some javascript to your view or layout templates to render the flash in the browser.

Note that the cookie holding the flash messages is removed as the page is displayed, so a refresh will clear the flash message (just as happens normally).

=== Example Controller

class MyController < ActionController::Base include CacheableFlash # ... end

=== Example Template Markup

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'