Created
December 10, 2011 17:57
-
-
Save leonid-shevtsov/1455766 to your computer and use it in GitHub Desktop.
PRECOMPILE ALL THE ASSETS!
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
# This snippet adds any and all CSS and JS files in asset directories to list of precompiled assets. | |
# Avoid the dreaded 'whatever.js isn't precompiled' error | |
config.assets.precompile += Dir['app/assets/stylesheets/**/*.css'].map{|f| f.gsub('app/assets/stylesheets/','')} | |
config.assets.precompile += Dir['app/assets/javascripts/**/*.js'].map{|f| f.gsub('app/assets/javascripts/','')} | |
To put this into perspective, the code was used to hotfix a project upgraded to 3.1 when it started to throw up precompilation errors in production.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Succinctly :)