diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-27 20:27:57 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-27 20:27:57 +0200 |
commit | c5583cd79c17a56eafdf2666a136694125ec7485 (patch) | |
tree | 4856d80bce7ddfadd965790ffefeea458b1bf9b2 /actionview/lib/action_view/helpers | |
parent | 0a780b1e8527c7d1bc764d6b6423966ff0381af4 (diff) | |
parent | a6509d31126d3533689480a5290f518671d5d8c9 (diff) | |
download | rails-c5583cd79c17a56eafdf2666a136694125ec7485.tar.gz rails-c5583cd79c17a56eafdf2666a136694125ec7485.tar.bz2 rails-c5583cd79c17a56eafdf2666a136694125ec7485.zip |
Merge pull request #20904 from kaspth/wildcard-template-dependencies
Add wildcard template dependencies.
Diffstat (limited to 'actionview/lib/action_view/helpers')
-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. # |