Skip to content

Instantly share code, notes, and snippets.

@woods
Created January 8, 2015 14:40
Show Gist options
  • Save woods/4d4af26fb91f51d73c72 to your computer and use it in GitHub Desktop.
Save woods/4d4af26fb91f51d73c72 to your computer and use it in GitHub Desktop.
An example of a helper for determining which instance/flavor we're running.
# A helper for determining which partner site we're on. This can be
# used for setting a CSS class on the body tag in the layout, or
# for referencing namespaced assets or translations.
def parner(host=request.host)
if $ENV['PARTNER'] == 'graduate' || host =~ /graduate/i
'graduate'
elsif $ENV['PARTNER'] == 'schreyer' || host =~ /schreyer/i
'schreyer'
else
# decide whether to fail or default to one of the above
end
end
@woods
Copy link
Author

woods commented Jan 10, 2015

Although it is a little less slick than just being able to symlink and open http://schreyer.dev/ ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment