6

I came to know that during pre-compilation of assets in production mode, Rails will take assets from 'app/assets' only by default if we do not require files explictly from any other specific sources like 'vendor/assets' and 'lib/assets'.

I've a question:

Will require_tree . load assets from 'vendor/assets' and 'lib/assets' ?

Rajesh Omanakuttan
  • 6,788
  • 7
  • 47
  • 85

1 Answers1

11

No, require_tree . will only load the assets in the local directory, hence the dot after require_tree, which specifies only the directory where the application asset file exists. If you want to include files in vendor/assets and lib/assets, you should do something like this (or similar for stylesheets):

//= require_tree ../../../vendor/assets/javascripts/.
//= require_tree ../../../lib/assets/javascripts/.

(From this question.)

Community
  • 1
  • 1
jvperrin
  • 3,368
  • 1
  • 23
  • 33