简体   繁体   中英

Rails asset pipeline require

In rails to require a file in the vendor directory I know that I can do this in my application.j file.

//=require vendor/assets/javascripts/me.js

Am wondering how does one require the entire javascript folder in the vendor directory

//= require_tree ../../../vendor/assets/javascripts/include/.

See http://guides.rubyonrails.org/asset_pipeline.html#asset-organization

Try

//=require me

Vendor should be loaded by default

Assets are not namespaced

You might need to restart your dev server after adding to vendor

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