Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@neudabei
Created September 6, 2016 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neudabei/fc053e41336e6efe509afc3fae61f9fe to your computer and use it in GitHub Desktop.
Save neudabei/fc053e41336e6efe509afc3fae61f9fe to your computer and use it in GitHub Desktop.
vanity/test/dummy/app/controllers/use_vanity_controller.rb
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