Methods

Included Modules

Class Index [+]

Quicksearch

Ramaze::Helper::Flash

Public Instance Methods

flash() click to toggle source

Return the current value of Current.session.flash

    # File lib/ramaze/helper/flash.rb, line 32
32:       def flash
33:         Current.session.flash
34:       end
flashbox(tag = ancestral_trait[:flashbox]) click to toggle source

Use in your template to display all flash messages that may be stored. For example, given you stored:

  flash # => { :error => 'Pleae enter your name'
               :info => 'Do you see the fnords?' }

Then a flashbox would display:

  <div class='flash' id='flash_error'>Please enter your name</div>
  <div class='flash' id='flash_info'>Do you see the fnords?</div>

This is designed to be customized permanently or per usage:

  flashbox("<div class='flash_%key'>%value</div>")

Where any occurrence of %key and %value will be replaced by the actual contents of each element of flash

    # File lib/ramaze/helper/flash.rb, line 53
53:       def flashbox(tag = ancestral_trait[:flashbox])
54:         flash.map{|key, *values|
55:           values.flatten.map do |value|
56:             tag.gsub(/%key/, key.to_s).gsub(/%value/, value.to_s)
57:           end
58:         }.flatten.join("\n")
59:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.