Sha256: f357c52752c13518ecdbe53c3015762f1902538b3c82b1c31987546f2a48a34e

Contents?: true

Size: 1019 Bytes

Versions: 24

Compression:

Stored size: 1019 Bytes

Contents

module Innate
  module Helper
    # Simple access to session.flash.
    #
    # Flash is a mechanism using sessions to provide a rotating holder of
    # key/value pairs.
    #
    # Every request that is made will rotate one step, dropping contents stored
    # two requests ago.
    #
    # 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 Flash
      # Just for convenience
      def flash
        session.flash
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
manveru-innate-2009.02.06 lib/innate/helper/flash.rb
manveru-innate-2009.02.21 lib/innate/helper/flash.rb
manveru-innate-2009.02.25 lib/innate/helper/flash.rb
manveru-innate-2009.03.24 lib/innate/helper/flash.rb
manveru-innate-2009.04.01 lib/innate/helper/flash.rb
manveru-innate-2009.04.08 lib/innate/helper/flash.rb
manveru-innate-2009.04.18 lib/innate/helper/flash.rb
manveru-innate-2009.04 lib/innate/helper/flash.rb
manveru-innate-2009.05 lib/innate/helper/flash.rb
manveru-innate-2009.06.12 lib/innate/helper/flash.rb
manveru-innate-2009.06 lib/innate/helper/flash.rb
manveru-innate-2009.07 lib/innate/helper/flash.rb
rjspotter-innate-2009.06.29 lib/innate/helper/flash.rb
rjspotter-innate-2009.06.30 lib/innate/helper/flash.rb
rjspotter-innate-2009.06.31 lib/innate/helper/flash.rb
innate-2010.03 lib/innate/helper/flash.rb
innate-2010.01 lib/innate/helper/flash.rb
innate-2009.10 lib/innate/helper/flash.rb
innate-2009.07 lib/innate/helper/flash.rb
innate-2009.04.12 lib/innate/helper/flash.rb