class method
self.new
Ruby on Rails 3.0.20
Since v2.2.3 Last seen in v3.2.22.5Signature
self.new(controller, options = {}, infer_extension = true)
If infer_extension is true, the cache path extension is looked up from the request’s path & format. This is desirable when reading and writing the cache, but not when expiring the cache - expire_action should expire the same files regardless of the request format.
Parameters
-
controllerreq -
optionsopt = {} -
infer_extensionopt = true
Source
# File actionpack/lib/action_controller/caching/actions.rb, line 166
def initialize(controller, options = {}, infer_extension = true)
if infer_extension
@extension = controller.params[:format]
options.reverse_merge!(:format => @extension) if options.is_a?(Hash)
end
path = controller.url_for(options).split(%r{://}).last
@path = normalize!(path)
end
Defined in actionpack/lib/action_controller/caching/actions.rb line 166
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Caching::Actions::ActionCachePath