I understand how to add one javascript file to rails assets pipeline. Just add
//= require filename
to application.js
But how can I include many javscripts files under one folder
vendor/assets/javascripts/<js_library>
Or I have to list them all explicitly ?
//= require_tree .
will require everything in the current directory of your application.js
//= require_tree ./js_library
will require everything in the js_library
subdirectory if it is under app/assets/javascripts
If you are are trying to load javascripts under vendor/assets/javascripts, try:
//= require_tree ../../../vendor/assets/javascripts/js_library
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With