Reputation: 679
how to load tree(!) of vendor to rails 3 app ?
Now Im using this way:
//= require vendor ../../../vendor/assets/ {stylesheet or javascript}
And this won't work for me:
require_tree vendor OR require vendor
Upvotes: 0
Views: 226
Reputation: 35360
I suggest you create files like
vendor/assets/javascripts/vendor.js
vendor/assets/stylesheets/vendor.css
Inside vendor.js
you can do
//= require_tree .
and inside vendor.css
you can do
/*
*= require_tree .
*/
And then inside app/assets/javascripts/vendor.js
put
//= require vendor
and in app/assets/stylesheets/vendor.css
put
/*
*= require vendor
*/
It should be noted, once you get more than a couple files you want to include, you're very likely better off avoiding require_tree
and instead using a //= require
line for each file independently. This lets you order your assets properly to ensure any dependencies on one another are resolved. By doing what I describe above you set yourself up for success with the individual //= require
lines in your vendor/
directories when that time comes.
Upvotes: 1