Created
November 14, 2012 03:32
-
-
Save ilake/4070078 to your computer and use it in GitHub Desktop.
Rails config.assets.precompile setting to process all CSS and JS files in app/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
| config.assets.precompile << Proc.new { |path| | |
| if path =~ /\.(css|js)\z/ | |
| full_path = Rails.application.assets.resolve(path).to_path | |
| app_assets_path = Rails.root.join('app', 'assets').to_path | |
| if full_path.starts_with? app_assets_path | |
| puts "including asset: " + full_path | |
| true | |
| else | |
| puts "excluding asset: " + full_path | |
| false | |
| end | |
| else | |
| false | |
| end | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment