diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-15 23:32:45 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-26 19:21:14 +0200 |
commit | a6509d31126d3533689480a5290f518671d5d8c9 (patch) | |
tree | 2a4ae12f52013563dd3520c45f75e836dbe1179c /actionview/lib/action_view/helpers/cache_helper.rb | |
parent | cdc32defcfc2ce5312c4b02e09f6cef2172843c6 (diff) | |
download | rails-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.rb | 14 |
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. # |