Browse files

[engines] [ci-skip] Add example of precompiling engine assets

  • Loading branch information...
1 parent 152798f commit 5fdcda8b220af7042d4b5111fa16090ebaf16926 adman65 committed Mar 22, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 guides/source/engines.textile
15 guides/source/engines.textile
@@ -723,6 +723,21 @@ You can also specify these assets as dependencies of other assets using the Asse
+h4. Separate Assets & Precompiling
+There are some situations where your engine's assets not required by the host application. For example, say that you've created
+an admin functionality that only exists for your engine. In this case, the host application doesn't need to require +admin.css+
+or +admin.js+. Only the gem's admin layout needs these assets. It doesn't make sense for the host app to include +"blorg/admin.css"+ in it's stylesheets. In this situation, you should explicitly define these assets for precompilation.
+This tells sprockets to add you engine assets when +rake assets:precompile+ is ran.
+You can define assets for precompilation in +engine.rb+
+initializer do |app|
+ app.config.assets.precompile += %w(admin.css admin.js)
For more information, read the "Asset Pipeline guide":
h4. Other gem dependencies

0 comments on commit 5fdcda8

Please sign in to comment.