在资产管道中需要树

Ver*_*gün 6 ruby pipeline assets ruby-on-rails

我的资产管道中有一个名为fontfaces的文件夹.它的工作原理没有任何补充application.rb.

在目录中我有不同的字体类型,如文件夹中的.eof,.ttf等,就像这样

Assets
    Typefaces
        Eof
           ...files
        Ttf
           ...files
Run Code Online (Sandbox Code Playgroud)

除非字体是资产/字体,否则它们不会成为资产管道的一部分.资产管道不会进入子目录.

我如何让资产管道超越资产/字体到资产/字体/ eof,资产/字体/ ttf等?

Kle*_* S. 13

在您的app/assets/javascripts/application.js文件中,尝试放:

//= require_tree ../Typefaces

查看更多:http: //guides.rubyonrails.org/asset_pipeline.html

如果有效,请告诉我.


Tai*_*aiz 6

在application.css中

/*
*= require_self
*= require_tree ./folder_name/

*/
Run Code Online (Sandbox Code Playgroud)

详细参考:http://railscasts.com/episodes/279-understanding-the-asset-pipeline? view= asciicast