Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
Created November 8, 2012 00:06
Show Gist options
  • Save gaboesquivel/4035514 to your computer and use it in GitHub Desktop.
Save gaboesquivel/4035514 to your computer and use it in GitHub Desktop.
Esto tambien lo soluciona.....
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