There is a require for individual files like so:
//= require controllers/documents
Is there an equivalent for requiring a directory?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yep:
By the way, you tagged this as
coffeescript, but your question uses JavaScript comment syntax… so for the record, in CoffeeScript you want to use#=, not//=.Also, this is actually a Sprockets question, not a Rails question. Sprockets is a default in Rails 3.1, but you can use it independently as well. At any rate, the Sprockets page offers documentation aplenty on
require,require_tree, and many other handy directives.