aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Hulse <richard.hulse@radionz.co.nz>2012-05-16 22:06:10 +1200
committerRichard Hulse <richard.hulse@radionz.co.nz>2012-05-16 22:06:10 +1200
commitf94567a2b8129af28fa328e8f71186d9ea9b5aac (patch)
tree9d573432ea35ee6d52b392a2c619b53e77009540
parent950a7b40af1b32df17dcb9c9304b1f48f4e8fafc (diff)
downloadrails-f94567a2b8129af28fa328e8f71186d9ea9b5aac.tar.gz
rails-f94567a2b8129af28fa328e8f71186d9ea9b5aac.tar.bz2
rails-f94567a2b8129af28fa328e8f71186d9ea9b5aac.zip
[guides] add note about cosequences of option changes
-rw-r--r--guides/source/asset_pipeline.textile4
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/asset_pipeline.textile b/guides/source/asset_pipeline.textile
index 116a0a371a..316f1b9171 100644
--- a/guides/source/asset_pipeline.textile
+++ b/guides/source/asset_pipeline.textile
@@ -545,7 +545,9 @@ config.assets.initialize_on_precompile = false
The +prefix+ change makes Rails use a different URL for serving assets in development mode, and pass all requests to Sprockets. The prefix is still set to +/assets+ in the production environment. Without this change, the application would serve the precompiled assets from +public/assets+ in development, and you would not see any local changes until you compile assets again.
-The +initialize_on_precompile+ change tell the precompile task to run without invoking Rails. You will also need to ensure that any compressors or minifiers are available on your development system.
+The +initialize_on_precompile+ change tell the precompile task to run without invoking Rails. This is because the precompile task runs in production mode by default, and without this change the task would attempt to connect to your specfied production database. Please note that you cannot have code in pipeline files that relies on Rails resources (such as the database) when compiling locally with this option.
+
+You will also need to ensure that any compressors or minifiers are available on your development system.
In practice, this will allow you to precompile locally, have those files in your working tree, and commit those files to source control when needed. Development mode will work as expected.