Skip to content

Instantly share code, notes, and snippets.

@thomasv314
Created January 15, 2014 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasv314/8447084 to your computer and use it in GitHub Desktop.
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.
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