From 6e00c05607c03eead00966a5de4769b2e77af196 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 2 Oct 2011 11:35:41 -0700 Subject: [PATCH] documents config.assets.initialize_on_precompile in the asset pipeline guide --- railties/guides/source/asset_pipeline.textile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index a0af018d30d..da0ffb80d29 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -346,6 +346,13 @@ 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. + Capistrano (v2.8.0 and above) has a recipe to handle this in deployment. Add the following line to +Capfile+: