简体   繁体   中英

Require tree in asset pipeline

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?

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.

In application.css

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

*/

Detailed Reference: http://railscasts.com/episodes/279-understanding-the-asset-pipeline?view=asciicast

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM