Reputation: 4732
I am trying to use the rails 3.1 asset pipeline to include a javascript file from the manifest file's parent directory
app/assets/javascripts/folder/index.js
//=require ../file
yields: couldn't find file 'file'
How do I require a file from the parent directory?
Upvotes: 2
Views: 1346
Reputation: 21884
Assets in Sprockets are always referenced by their logical path.
So you just have to use //=require file
if your file is in /app/assets/javascripts
.
If your file was /lib/assets/javascripts/models/lala.js
for instance, you would require it with //=require models/lala
.
Upvotes: 3