Skip to content

Instantly share code, notes, and snippets.

@hughevans
Created March 5, 2013 22:47
Show Gist options
  • Select an option

  • Save hughevans/5095061 to your computer and use it in GitHub Desktop.

Select an option

Save hughevans/5095061 to your computer and use it in GitHub Desktop.
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# Load fonts from S3 only and not CloudFront because of cached CORS header issue
config.action_controller.asset_host = Proc.new do |source|
if source =~ /(.woff|.eot|.ttf)/
"http://#{ENV['ASSETS_AWS_BUCKET']}.s3-#{ENV['ASSETS_AWS_REGION']}.amazonaws.com"
else
"http://#{ENV["ASSETS_CLOUD_FRONT_DOMAIN"]}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment