Sha256: e75180b245b5bd85ab6e0d4db062b839733de9146a1c794646344e29804354fe

Contents?: true

Size: 701 Bytes

Versions: 9

Compression:

Stored size: 701 Bytes

Contents

class UseVanityController < ActionController::Base
  class TestModel
    def test_method
      Vanity.ab_test(:pie_or_cake)
    end
  end

  attr_accessor :current_user

  def index
    text = Vanity.ab_test(:pie_or_cake)
    render :plain=>text, :text=>text
  end

  def js
    Vanity.ab_test(:pie_or_cake)
    render :inline => "<%= vanity_js -%>"
  end

  def view_helper_ab_test_js
    render :inline => <<-EOS
    <% ab_test(:pie_or_cake) %>
    <%= vanity_js -%>
EOS
  end

  def global_ab_test_js
    render :inline => <<-EOS
    <% Vanity.ab_test(:pie_or_cake) %>
    <%= vanity_js -%>
EOS
  end

  def model_js
    TestModel.new.test_method
    render :inline => "<%= vanity_js -%>"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vanity-3.1.0 test/dummy/app/controllers/use_vanity_controller.rb
vanity-3.0.2 test/dummy/app/controllers/use_vanity_controller.rb
vanity-3.0.1 test/dummy/app/controllers/use_vanity_controller.rb
vanity-3.0.0 test/dummy/app/controllers/use_vanity_controller.rb
vanity-2.2.10 test/dummy/app/controllers/use_vanity_controller.rb
vanity-2.2.9 test/dummy/app/controllers/use_vanity_controller.rb
vanity-2.2.8 test/dummy/app/controllers/use_vanity_controller.rb
vanity-2.2.7 test/dummy/app/controllers/use_vanity_controller.rb
vanity-2.2.6 test/dummy/app/controllers/use_vanity_controller.rb