Module: ABChoiceHelper

Defined in:
lib/helpers/ab_choice_helper.rb

Instance Method Summary collapse

Instance Method Details

#ab_choice(selected_choice_value, &block) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/helpers/ab_choice_helper.rb', line 2

def ab_choice(selected_choice_value, &block)
  @ab_choice ||= find_or_create_choice

  if @ab_choice.choice == selected_choice_value.to_s
    capture &block
  else
    nil
  end
end