Browse files

rewords the docs of config.assets.initialize_on_precompile in the ass…

…et pipeline guide
  • Loading branch information...
1 parent 6e00c05 commit ac1fc5c59499db8d3e875bbd76e0b7c2c9240089 @fxn fxn committed Oct 2, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 railties/guides/source/asset_pipeline.textile
14 railties/guides/source/asset_pipeline.textile
@@ -346,12 +346,14 @@ The rake task is:
bundle exec rake assets:precompile
-Asset templates in general have access to application objects. You may prevent application
-initialization in precompilation setting +config.assets.initialize_on_precompile+ to false.
-WARNING: Application objects may still be in scope in asset templates in develoment mode.
-If +config.assets.initialize_on_precompile+ is set to false it is your responsability not
-to use them at all.
+For faster asset precompiles, you can partially load your application by setting
++config.assets.initialize_on_precompile+ to false, though in that case templates
+cannot see application objects or methods. *Heroku requires this to be false.*
+WARNING: If you set +config.assets.initialize_on_precompile+ to false, be sure to
+test +rake assets:precompile+ locally before deploying. It may expose bugs where
+your assets reference application objects or methods, since those are still
+in scope in development mode regardless of the value of this flag.
Capistrano (v2.8.0 and above) has a recipe to handle this in deployment. Add the following line to +Capfile+:

0 comments on commit ac1fc5c

Please sign in to comment.