在资产管道中需要树 [英] Require tree in asset pipeline

查看:74
本文介绍了在资产管道中需要树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在资产管道中有一个名为typefaces的文件夹.它无需添加application.rb即可工作.

I have a folder in my asset pipeline called typefaces. It works without any additions to application.rb.

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

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.

我如何使资产管道从资产/字体变成资产/字体/eof,资产/字体/ttf等?

How would I have asset pipeline look beyond assets/typefaces into assets/typefaces/eof, assets/typefaces/ttf etc?

推荐答案

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

In your app/assets/javascripts/application.js file, try putting:

//= require_tree ../Typefaces

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

让我知道是否可行.

这篇关于在资产管道中需要树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆