Last active
August 29, 2015 14:02
-
-
Save lordhumunguz/dfbba95b613c55c43f9b to your computer and use it in GitHub Desktop.
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 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