Rails asset pipeline: Standard way for including all /vendor/assets/javascripts/?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 18:06:05

You can add something like this in your app/assets/javascripts/application.js file to include all the vendor javascripts:

//= require_tree ../../../vendor/assets/javascripts/.
lcguida

I know it's an old question, but you can create a manifest file on the vender/assets/javascript folder:

 #vendor/assets/javascripts/my_jquery_plugins/manifest.js
 # require_tree .

And in you application.js:

 //= require my_jquery_plugins/manifest.js

If you're using Rails 4, name the manifest.js as index.js and in your application.js:

//= require my_jquery_plugins

It's less hacky than relative path described.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!