I am trying to convert an existing app to the new 3.1 asset pipeline layout, and want to include a lot of vendor files that have to be in a specific order, (underscore.js an
require_tree does exactly what you tell it. If you give it
//= require_tree .
it loads the files in the current directory where require_tree is called. If you give it
//=require_tree ../../../vendor/assets/javascripts
then you'll get the javascript under vendor.
I did not like the ../../.. notation, so I created a file called vendor/assets/javascripts/vendor_application.js which contains:
//= require_tree .
That loads the javascript under the vendor directory.
Note, require does search the 3 pipeline locations (app, lib, vendor) for the file to require. require_tree is literal, which is probably the way it should be.
The railscast on this is very helpful: http://railscasts.com/episodes/279-understanding-the-asset-pipeline