class method self.new

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v3.2.22.5

Available in: v2.2.3 v2.3.18 v3.0.20 v3.1.12 v3.2.22.5

Signature

self.new(controller, options = {}, infer_extension=true)

When true, infer_extension will look up the cache path extension 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

controller req
options opt = {}
infer_extension opt = true
Source
# File actionpack/lib/action_controller/caching/actions.rb, line 139
        def initialize(controller, options = {}, infer_extension=true)
          if infer_extension and options.is_a? Hash
            request_extension = extract_extension(controller.request)
            options = options.reverse_merge(:format => request_extension)
          end
          path = controller.url_for(options).split('://').last
          normalize!(path)
          if infer_extension
            @extension = request_extension
            add_extension!(path, @extension)
          end
          @path = URI.unescape(path)
        end

Defined in actionpack/lib/action_controller/caching/actions.rb line 139 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Caching::Actions::ActionCachePath

Type at least 2 characters to search.

↑↓ navigate · open · esc close