module ActionController::EtagWithTemplateDigest

def determine_template_etag(options)

def determine_template_etag(options)
  if template = pick_template_for_etag(options)
    lookup_and_digest_template(template)
  end
end

def lookup_and_digest_template(template)

def lookup_and_digest_template(template)
  ActionView::Digestor.digest name: template, format: nil, finder: lookup_context
end

def pick_template_for_etag(options)

digest from the ETag.
default controller/action template. If `:template` is false, omit the template
present, use the named template. If `:template` is `nil` or absent, use the
Pick the template digest to include in the ETag. If the `:template` option is
def pick_template_for_etag(options)
  unless options[:template] == false
    options[:template] || lookup_context.find_all(action_name, _prefixes).first&.virtual_path
  end
end