class method
self.new
Ruby on Rails 4.1.16
Since v3.1.12Signature
self.new(root, cache_control)
No documentation comment.
Parameters
-
rootreq -
cache_controlreq
Source
# File actionpack/lib/action_dispatch/middleware/static.rb, line 6
def initialize(root, cache_control)
@root = root.chomp('/')
@compiled_root = /^#{Regexp.escape(root)}/
headers = cache_control && { 'Cache-Control' => cache_control }
@file_server = ::Rack::File.new(@root, headers)
end
Defined in actionpack/lib/action_dispatch/middleware/static.rb line 6
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::FileHandler