Sha256: 507377f1f2a407890b087cbf89869f7d0c871814f5a85104a00ebdd71bc8906e

Contents?: true

Size: 886 Bytes

Versions: 9

Compression:

Stored size: 886 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

module Ramaze

  # The purpose of this class is to provide an easy way of setting/retrieving
  # from the current flash.
  #
  # Flash is a way to keep a temporary pairs of keys and values for the duration
  # of two requests, the current and following.
  #
  # Very vague Example:
  #
  # On the first request, for example on registering:
  #
  #   flash[:error] = "You should reconsider your username, it's taken already"
  #   redirect R(self, :register)
  #
  # This is the request from the redirect:
  #
  #   do_stuff if flash[:error]
  #
  # On the request after this, flash[:error] is gone.

  module FlashHelper
    private

    # answers with Session.current.flash

    def flash
      Session.current.flash
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ramaze-0.0.8 lib/ramaze/helper/flash.rb
ramaze-0.0.9 lib/ramaze/helper/flash.rb
ramaze-0.1.1 lib/ramaze/helper/flash.rb
ramaze-0.1.0 lib/ramaze/helper/flash.rb
ramaze-0.1.3 lib/ramaze/helper/flash.rb
ramaze-0.1.4 lib/ramaze/helper/flash.rb
ramaze-0.1.2 lib/ramaze/helper/flash.rb
ramaze-0.2.0 lib/ramaze/helper/flash.rb
ramaze-0.2.1 lib/ramaze/helper/flash.rb