instance method
cache
Ruby on Rails 6.0.6
Since v5.2.8.1 PrivateSignature
cache(key, options = {}, &block)
Convenience accessor.
Parameters
-
keyreq -
optionsopt = {} -
blockblock
Source
# File actionpack/lib/abstract_controller/caching.rb, line 58
def cache(key, options = {}, &block) # :doc:
if cache_configured?
cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
else
yield
end
end
Defined in actionpack/lib/abstract_controller/caching.rb line 58
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in AbstractController::Caching