What does "require tree" do in Rails 3.1?

In Rails 3.1…

This is my application.css:
*= require_self
*= require_tree .

This is my application.js:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .

What does the “require_tree .” do?

The first three requires bring in the files in
while the lastrequire_tree . tells sprockets to require everything in
same directory. The require order is alphabetical, so you may have to
things around or be more specific to correctly get your dependencies in

On Mon, Jul 18, 2011 at 10:07 PM, David Z. [email protected]

//= require jquery_ujs
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at

Rajeev Kannav

It’s slightly smarter than alphabetical. You can use #require_tree to
in the entire tree and then within individual sub files use #require to
force the ordering of specific files

Thanks. This site - http://ryanbigg.com/guides/asset_pipeline.html -
explained it pretty well…

The link has been changed The Asset Pipeline - Ryan Bigg