Skip to content

Instantly share code, notes, and snippets.

@amiel
Last active December 26, 2015 09:09
Show Gist options
  • Save amiel/7127338 to your computer and use it in GitHub Desktop.
Save amiel/7127338 to your computer and use it in GitHub Desktop.
module ABTestHelper
def test
yield
end
def variant(variant)
if variant_matches(variant)
yield
end
end
def control
variant(nil)
end
private
def variant_matches(variant)
params[:variant] == variant
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment