Created
September 6, 2016 10:03
-
-
Save neudabei/fc053e41336e6efe509afc3fae61f9fe to your computer and use it in GitHub Desktop.
vanity/test/dummy/app/controllers/use_vanity_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UseVanityController < ActionController::Base | |
class TestModel | |
def test_method | |
Vanity.ab_test(:pie_or_cake) | |
end | |
end | |
attr_accessor :current_user | |
def index | |
render :text=>Vanity.ab_test(:pie_or_cake) | |
end | |
def js | |
Vanity.ab_test(:pie_or_cake) | |
render :inline => "<%= vanity_js -%>" | |
end | |
def working_js | |
render :inline => <<-EOS | |
<% ab_test(:pie_or_cake) %> | |
<%= vanity_js -%> | |
EOS | |
end | |
def broken_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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment