问题
I have a folder in my asset pipeline called typefaces. It works without any additions to application.rb
.
In the directory I have different typeface types, like .eof, .ttf, etc in folders, like this
Assets
Typefaces
Eof
...files
Ttf
...files
Unless the typefaces are in Assets/typefaces they don't become part of asset pipeline. Asset pipeline doesn't go into the subdirectories.
How would I have asset pipeline look beyond assets/typefaces into assets/typefaces/eof, assets/typefaces/ttf etc?
回答1:
In your app/assets/javascripts/application.js
file, try putting:
//= require_tree ../Typefaces
See more: http://guides.rubyonrails.org/asset_pipeline.html
Let me know if that works.
回答2:
In application.css
/*
*= require_self
*= require_tree ./folder_name/
*/
Detailed Reference: http://railscasts.com/episodes/279-understanding-the-asset-pipeline?view=asciicast
来源:https://stackoverflow.com/questions/13105387/require-tree-in-asset-pipeline