Compiled assets

Hi, I have compiled assets from smartadmin in a /dist folder. I copied these to app/assets/dist.

I don’t know how to reference these files both css and javascript in my manifests files. How is that done?

Thanks, Joe

The simplest thing I can think of is to treat them as you do images in that manifest, and use //= link_tree ../dist. That should work as long as the resources are not further segmented into subdirectories, like app/assets/dist/js and app/assets/dist/css and so forth. In that case, you would probably need to link_tree those subfolders directly.


ok i noticed a subfolder /config

it had a file called manifest.js which had the following … //= link_tree …/images //= link_directory …/javascripts .js //= link_directory …/stylesheets .css

how do i link this with the others

Ah, a sub-manifest! I am not sure how you do that explicitly. You might look at the docs for Sprockets to learn more. I would try making a link to that folder separately, like maybe //= link dist/config and see if it picks up that manifest.js as a sort of index page.

That might bootstrap loading all the rest of the stuff inside the dist folder, so you would not need to add any link_tree directives besides that initial link to the manifest.

To be clear, though – there should only be one manifest for your entire app, located by convention at [project]/app/assets/config/manifest.js

That’s the Sprockets equivalent of an entry point, from which it derives the tree of files that it cares about locating and fingerprinting and listing in the Asset Pipeline.

I’ve not heard of that manifest linking to other manifests and building out sub-collections like this. But then again, I may have just misunderstood your question.