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
vendor/assets/javascripts,
while the lastrequire_tree . tells sprockets to require everything in
the
same directory. The require order is alphabetical, so you may have to
move
things around or be more specific to correctly get your dependencies in
order.

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

//= 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
http://groups.google.com/group/rubyonrails-talk?hl=en.


Rajeev Kannav
Sharmahttp://www.google.com/search?q=Rajeev+Kannav+Sharma&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

It’s slightly smarter than alphabetical. You can use #require_tree to
pull
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 https://ryanbigg.com/2011/06/the-asset-pipeline

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs