Module: Ext::Flash

Extended by:
Equipment
Defined in:
lib/ext/flash.rb

Overview

Hilight some things for a short time. It’s very convenient to have some look over things in the night. See Helpers#flash for more options.

How it works

For example, you set flash.info to “hey!”. Next time it is accessed, it will be available until the end of the controller’s execution. So on the next page, flash.info will be back to nil.

Example

in your controller :

def get
  flash.error = 'hey !'
  redirect R(Index)
end

in your view :

def index
  div.error(flash.error) if flash.error
  # ...
end

or in your layout.. like you want. The flashed data will then disappear on the next request.

Dependency

  • Equipment

Issues

The cookies are not deleted until the end of the session. This is because Camping does not provide this facility and I didn’t implement it. I think it is okay altrough.

Defined Under Namespace

Modules: Base, Helpers Classes: Flasher

Constant Summary

Constants included from Equipment

Equipment::DATA_PATH, Equipment::LIB_PATH

Instance Attribute Summary

Attributes included from Equipment

#debug

Method Summary

Methods included from Equipment

dependencies, depends_on, equip, equip_all, global_extensions, included