aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2016-06-27 16:59:49 -0400
committerJeremy Daer <jeremydaer@gmail.com>2016-06-28 11:59:41 -0700
commit893fc51003d36c86cdd88823d0f8ff77d0708a00 (patch)
tree9b76976e4e8de29037f415c02ff508f6af532e03 /actionpack/lib
parent754e5bdf8713b95c2bb9d2ab4656fd240da12181 (diff)
downloadrails-893fc51003d36c86cdd88823d0f8ff77d0708a00.tar.gz
rails-893fc51003d36c86cdd88823d0f8ff77d0708a00.tar.bz2
rails-893fc51003d36c86cdd88823d0f8ff77d0708a00.zip
Fix adding implicitly rendered template digests to ETags
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/etag_with_template_digest.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/etag_with_template_digest.rb b/actionpack/lib/action_controller/metal/etag_with_template_digest.rb
index 669cf55bca..75ac996793 100644
--- a/actionpack/lib/action_controller/metal/etag_with_template_digest.rb
+++ b/actionpack/lib/action_controller/metal/etag_with_template_digest.rb
@@ -39,8 +39,14 @@ module ActionController
end
end
+ # Pick the template digest to include in the ETag. If the +:template+ option
+ # is present, use the named template. If +:template+ is nil or absent, use
+ # the default controller/action template. If +:template+ is false, omit the
+ # template digest from the ETag.
def pick_template_for_etag(options)
- options.fetch(:template) { "#{controller_name}/#{action_name}" }
+ unless options[:template] == false
+ options[:template] || "#{controller_name}/#{action_name}"
+ end
end
def lookup_and_digest_template(template)