Skip to content

Instantly share code, notes, and snippets.

@lordhumunguz
Last active August 29, 2015 14:02
Show Gist options
  • Save lordhumunguz/dfbba95b613c55c43f9b to your computer and use it in GitHub Desktop.
Save lordhumunguz/dfbba95b613c55c43f9b to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def index
render text: index_html
end
private
def index_html
$redis.get "#{deploy_key}:index.html"
end
def deploy_key
# The latest deploy is the first item in the list
# If a deploy key is passed in, use that deploy, otherwise use the latest
params[:deploy_key] ? params[:deploy_key] : latest_deploy
end
def latest_deploy
$redis.lindex('manifest_ten_deploys', 0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment