instance method
match?
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v6.0.6Signature
match?(path)
No documentation comment.
Parameters
-
pathreq
Source
# File actionpack/lib/action_dispatch/middleware/static.rb, line 11
def match?(path)
path = path.dup
full_path = path.empty? ? @root : File.join(@root, escape_glob_chars(unescape_path(path)))
paths = "#{full_path}#{ext}"
matches = Dir[paths]
match = matches.detect { |m| File.file?(m) }
if match
match.sub!(@compiled_root, '')
::Rack::Utils.escape(match)
end
end
Defined in actionpack/lib/action_dispatch/middleware/static.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::FileHandler