Created
April 7, 2017 12:14
-
-
Save kplawver/594094da36115a9f15bbdef2d606ea85 to your computer and use it in GitHub Desktop.
How to skip including the asset host when precompiling assets, which is pretty important if you use Heroku pipelines and your CDN is different between stages!
This file contains 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
namespace :assets do | |
desc "Unsets the asset host, so it's not included in JS and CSS asset urls during precompile." | |
task :unset_asset_host => :environment do | |
ActionController::Base.asset_host = "" | |
end | |
Rake::Task["assets:precompile"].enhance(["assets:unset_asset_host"]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment