instance method
cached
Ruby on Rails 5.2.8.1
Since v3.0.20 Last seen in v6.1.7.10 PrivateSignature
cached(key, path_info, details, locals)
Handles templates caching. If a key is given and caching is on always check the cache before hitting the resolver. Otherwise, it always hits the resolver but if the key is present, check if the resolver is fresher before returning it.
Parameters
-
keyreq -
path_inforeq -
detailsreq -
localsreq
Source
# File actionview/lib/action_view/template/resolver.rb, line 181
def cached(key, path_info, details, locals)
name, prefix, partial = path_info
locals = locals.map(&:to_s).sort!
if key
@cache.cache(key, name, prefix, partial, locals) do
decorate(yield, path_info, details, locals)
end
else
decorate(yield, path_info, details, locals)
end
end
Defined in actionview/lib/action_view/template/resolver.rb line 181
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Resolver