Created
January 15, 2014 23:46
-
-
Save thomasv314/8447084 to your computer and use it in GitHub Desktop.
An example of how we check to see if the current visitor is allowed to see the beta running in production.
This file contains hidden or 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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :check_beta, :except => [ :beta ] | |
def beta | |
render :layout => "blank" | |
end | |
protected | |
def check_beta | |
is_in_beta = true | |
if Rails.env == "production" | |
if params[:show_me_the_beta] == "true" | |
session[:see_beta] = true | |
end | |
if !session[:see_beta] | |
redirect_to beta_path | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment