Module: Bandit::ViewConcerns::InstanceMethods
- Defined in:
- lib/bandit/extensions/view_concerns.rb
Instance Method Summary collapse
Instance Method Details
#bandit_choose(exp) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/bandit/extensions/view_concerns.rb', line 12 def bandit_choose(exp) name = "bandit_#{exp}".intern # choose url param with preference value = params[name].nil? ? .signed[name] : params[name] # choose with default, and set cookie .signed[name] = Bandit.get_experiment(exp).choose(value) end |