Created
November 8, 2012 00:06
-
-
Save gaboesquivel/4035514 to your computer and use it in GitHub Desktop.
Esto tambien lo soluciona.....
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
module AbTests::ControllerHelpers | |
def randomize_ab_version | |
"rtc" | |
end | |
def get_ab_version | |
if params[:ab_version] | |
cookies[:ab_version] = params[:ab_version] | |
else | |
# cookies[:ab_version] ||= randomize_ab_version | |
end | |
end | |
def redirect_to_ab_version! | |
if get_ab_version == "rtc" and not request.host.include?(get_ab_version) | |
redirect_to "http://#{get_ab_version}.#{request.host.gsub("www.","")+request.fullpath}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment