diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-15 17:10:28 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-15 17:27:33 -0800 |
commit | 1581cab9ff26731ed03a17f7ddec3c85d536988a (patch) | |
tree | 3691cb09659fcd6b3e140926b07ddd589dad4a41 /actionview/lib/action_view/template | |
parent | 3aa3c0684d3bd748be9e85d25616a8a7a1ab7755 (diff) | |
download | rails-1581cab9ff26731ed03a17f7ddec3c85d536988a.tar.gz rails-1581cab9ff26731ed03a17f7ddec3c85d536988a.tar.bz2 rails-1581cab9ff26731ed03a17f7ddec3c85d536988a.zip |
Pass the template format to the digestor
This commit passes the template format to the digestor in order to come
up with a key. Before this commit, the digestor would depend on the
side effect of the template renderer setting the rendered_format on the
lookup context. I would like to remove that mutation, so I've changed
this to pass the template format in to the digestor.
I've introduced a new instance variable that will be alive during a
template render. When the template is being rendered, it pushes the
current template on to a stack, setting `@current_template` to the
template currently being rendered. When the cache helper asks the
digestor for a key, it uses the format of the template currently on the
stack.
Diffstat (limited to 'actionview/lib/action_view/template')
-rw-r--r-- | actionview/lib/action_view/template/handlers/erb/erubi.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template/handlers/erb/erubi.rb b/actionview/lib/action_view/template/handlers/erb/erubi.rb index 20510c3062..247b6d75d1 100644 --- a/actionview/lib/action_view/template/handlers/erb/erubi.rb +++ b/actionview/lib/action_view/template/handlers/erb/erubi.rb @@ -27,7 +27,7 @@ module ActionView include action_view_erb_handler_context._routes.url_helpers class_eval("define_method(:_template) { |local_assigns, output_buffer| #{src} }", @filename || "(erubi)", 0) }.empty - view.run(:_template, {}, ActionView::OutputBuffer.new) + view.run(:_template, nil, {}, ActionView::OutputBuffer.new) end private |