instance method
cache
Ruby on Rails 3.0.20
Since v2.2.3 Last seen in v4.2.9Signature
cache(key, options = {}, &block)
Convenience accessor
Parameters
-
keyreq -
optionsopt = {} -
blockblock
Source
# File actionpack/lib/action_controller/caching.rb, line 76
def cache(key, options = {}, &block)
if cache_configured?
cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
else
yield
end
end
Defined in actionpack/lib/action_controller/caching.rb line 76
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Caching