aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRichard Hulse <richard.hulse@radionz.co.nz>2011-08-07 09:37:39 +1200
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:33 -0700
commitb840d71bfb702b121b48832f984090e202793f10 (patch)
treeb04c7bb119c71453963c3adaf194ec5eabac78a3 /railties
parentdbf22560c627c9b639d201887c137e822e4464be (diff)
downloadrails-b840d71bfb702b121b48832f984090e202793f10.tar.gz
rails-b840d71bfb702b121b48832f984090e202793f10.tar.bz2
rails-b840d71bfb702b121b48832f984090e202793f10.zip
[asset pipeline] Update Capistrano info
v2.8.0 of Capistrano has a recipe to handle precompile and symlinking.
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/asset_pipeline.textile10
1 files changed, 4 insertions, 6 deletions
diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile
index 13e28a25ba..3a87c90516 100644
--- a/railties/guides/source/asset_pipeline.textile
+++ b/railties/guides/source/asset_pipeline.textile
@@ -276,17 +276,15 @@ The rake task is:
rake assets:precompile
</plain>
-You can run this as part of a Capistrano deployment:
+Capistrano (v2.8.0+) has a recipe to to handle this in deployment. Add the following line to +Capfile+:
<erb>
-before 'deploy:symlink' do
- run "cd #{release_path}; RAILS_ENV=#{rails_env} rake assets:precompile"
-end
+load 'deploy/assets'
</erb>
-If you are not precompiling your assets, and you are using the default cache file store (which is the file system), you will need to symlink +rails_root/tmp/cache/assets+ from the shared folder that is part of the Capistrano deployment structure in order to persist the cached file between deployments.
+This links the folder specified in +config.assets.prefix+ to +shared/assets+. If you already use this folder you'll need to write your own deployment task.
-TODO: Extend above task to allow for this and add task to set it up (See commits 8f0e0b6 and 704ee0df). Note: Capistrano folks are working on a recipe - update this when it available (see https://github.com/capistrano/capistrano/pull/35).
+It is important for this folder is shared between deployments so that remotely cached pages that reference the old compiled assets still work for the life of the cached page.
The default matcher for compiling files will include +application.js+, +application.css+ and all files that do not end in +js+ or +css+: