Created
August 10, 2013 05:14
-
-
Save everaldo/6199153 to your computer and use it in GitHub Desktop.
How to add all assets inside app/assets to assets:precompile task References (I adapted from those links):
http://stackoverflow.com/questions/10097993/rails-config-assets-precompile-setting-to-process-all-css-and-js-files-in-app-as
http://stackoverflow.com/questions/12613980/how-do-i-use-config-assets-precompile-for-directories-rather-than-singl…
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
# Put that on config/environments/production.rb | |
config.assets.precompile << lambda do |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 | |
return true if full_path.starts_with? app_assets_path | |
end | |
false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to remove:
//= require_tree . # from application.js
and
*= require_tree . # from application.css
Require manually each file need in the manifests.