aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/cache_helper.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-07-15 23:32:45 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-07-26 19:21:14 +0200
commita6509d31126d3533689480a5290f518671d5d8c9 (patch)
tree2a4ae12f52013563dd3520c45f75e836dbe1179c /actionview/lib/action_view/helpers/cache_helper.rb
parentcdc32defcfc2ce5312c4b02e09f6cef2172843c6 (diff)
downloadrails-a6509d31126d3533689480a5290f518671d5d8c9.tar.gz
rails-a6509d31126d3533689480a5290f518671d5d8c9.tar.bz2
rails-a6509d31126d3533689480a5290f518671d5d8c9.zip
Add wildcard template dependencies.
Diffstat (limited to 'actionview/lib/action_view/helpers/cache_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/cache_helper.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb
index 797d029317..636d7d4cc3 100644
--- a/actionview/lib/action_view/helpers/cache_helper.rb
+++ b/actionview/lib/action_view/helpers/cache_helper.rb
@@ -98,7 +98,19 @@ module ActionView
# <%# Template Dependency: todolists/todolist %>
# <%= render_sortable_todolists @project.todolists %>
#
- # The pattern used to match these is <tt>/# Template Dependency: (\S+)/</tt>,
+ # In some cases, like a single table inheritance setup, you might have
+ # a bunch of explicit dependencies. Instead of writing every template out,
+ # you can use a wildcard to match any template in a directory:
+ #
+ # <%# Template Dependency: events/* %>
+ # <%= render_categorizable_events @person.events %>
+ #
+ # This marks every template in the directory as a dependency. To find those
+ # templates, the wildcard path must be absolutely defined from app/views or paths
+ # otherwise added with +prepend_view_path+ or +append_view_path+.
+ # This way the wildcard for `app/views/recordings/events` would be `recordings/events/*` etc.
+ #
+ # The pattern used to match explicit dependencies is <tt>/# Template Dependency: (\S+)/</tt>,
# so it's important that you type it out just so.
# You can only declare one template dependency per line.
#