Module: StickyParams
- Defined in:
- lib/sticky_params.rb,
lib/sticky_params/railtie.rb,
lib/sticky_params/version.rb,
lib/sticky_params/session_params.rb
Overview
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
selection = sticky_params[:name]
Defined Under Namespace
Classes: Railtie, SessionParams
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Method Summary collapse
-
#sticky_params ⇒ Object
A sicky parameter is a parameter that 'keeps' it state between pages, by storing the data in a session.
Instance Method Details
#sticky_params ⇒ Object
A sicky parameter is a parameter that 'keeps' it state between pages, by storing the data in a session
20 21 22 |
# File 'lib/sticky_params.rb', line 20 def sticky_params @sticky_params ||= ::StickyParams::SessionParams.new(self) end |