aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2013-01-08 11:20:47 -0700
committerJamis Buck <jamis@37signals.com>2013-01-08 11:20:47 -0700
commit70e684a681352e95fb990747ef6dd7183da333a8 (patch)
tree59ea8b888d7bc9c99cdcfab3ad4bf0f346244054 /actionpack/lib/action_view/helpers
parentac86cbec82acee18a5066e00b98d1c20fc677a15 (diff)
downloadrails-70e684a681352e95fb990747ef6dd7183da333a8.tar.gz
rails-70e684a681352e95fb990747ef6dd7183da333a8.tar.bz2
rails-70e684a681352e95fb990747ef6dd7183da333a8.zip
view_cache_dependency API
A declarative API for specifying dependencies that affect template cache digest computation. In your controller, specify any of said dependencies: view_cache_dependency { "phone" if using_phone? } When the block is evaluated, the resulting value is included in the cache digest calculation, allowing you to generate different digests for effectively the same template. (Mostly useful if you're mucking with template load paths.)
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/cache_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb
index 995aa10afb..8fc78ea7fb 100644
--- a/actionpack/lib/action_view/helpers/cache_helper.rb
+++ b/actionpack/lib/action_view/helpers/cache_helper.rb
@@ -167,7 +167,7 @@ module ActionView
if @virtual_path
[
*Array(name.is_a?(Hash) ? controller.url_for(name).split("://").last : name),
- Digestor.digest(@virtual_path, formats.last.to_sym, lookup_context)
+ Digestor.digest(@virtual_path, formats.last.to_sym, lookup_context, dependencies: view_cache_dependencies)
]
else
name