Sha256: 0c4c6969ee9b7e4b03a3ee0fd83692124d59f04774e692c19d78bc538737b892

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 Bytes

Contents

require "sticky_params/version"
require "sticky_params/railtie" if defined?(Rails)
require "sticky_params/session_params"
require "sticky_params/strong_session_params"

# Sticky Parameters is a nice hack that allows the 'remembering' a given param
# between page requests. When a param is supplied it is stored in a session.
#
# When the param isn't supplied it tries to recieve it from the session.
#
# When an 'empty-string' is supplied as param, the sticky_param is removed
#
# Use it the following way. Simply use sticky_params in stead of params
# <pre>
#   selection = sticky_params[:name]
# </pre>

module StickyParams
  # A sicky parameter is a parameter that 'keeps' it state between pages,
  # by storing the data in a session
  def sticky_params
    @sticky_params ||= ::StickyParams::StrongSessionParams.new(self)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sticky_params-2.1.0 lib/sticky_params.rb
sticky_params-2.0.0 lib/sticky_params.rb