From 49bc6a249e2a200216f8a96c36093a2c7a471c9b Mon Sep 17 00:00:00 2001
From: Craig R Webster <craig@barkingiguana.com>
Date: Sun, 21 Mar 2010 19:35:38 +0000
Subject: Allow customisation of asset path generation using a proc.

Set config.action_controller.asset_path_template to a proc that takes one
argument - the direct, unchanged asset path - and returns a path to that asset
using the scheme that your assets require.

This is useful if you have a setup which scales by introducing new application
servers where the mtime of the asset files may not be the same as those of the
asset files on your previous servers, but it does require your web servers to
have knowledge of the asset template paths that you rewrite to so it's not
suitable for out-of-the-box use. An example of configuring asset path
generation and rewriting these paths using Apache is included in
actionpack/lib/action_view/helpers/asset_tag_helper.rb.

Signed-off-by: wycats <wycats@gmail.com>
---
 railties/guides/source/configuring.textile | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'railties/guides/source/configuring.textile')

diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index 5418ad7dd4..e438d4cc0a 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -133,6 +133,8 @@ h4. Configuring Action Controller
 
 * +config.action_controller.asset_host+ provides a string that is prepended to all of the URL-generating helpers in +AssetHelper+. This is designed to allow moving all javascript, CSS, and image files to a separate asset host.
 
+* +config.action_controller.asset_template_path+ allows you to override the default asset path generation by providing your own instructions.
+
 * +config.action_controller.consider_all_requests_local+ is generally set to +true+ during development and +false+ during production; if it is set to +true+, then any error will cause detailed debugging information to be dumped in the HTTP response. For finer-grained control, set this to +false+ and implement +local_request?+ to specify which requests should provide debugging information on errors.
 
 * +config.action_controller.allow_concurrency+ should be set to +true+ to allow concurrent (threadsafe) action processing. Set to +false+ by default. You probably don't want to call this one directly, though, because a series of other adjustments need to be made for threadsafe mode to work properly. Instead, you should simply call +config.threadsafe!+ inside your +production.rb+ file, which makes all the necessary adjustments.
-- 
cgit v1.2.3

