instance method match?

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v6.0.6

Available in: v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6

Signature

match?(path)

No documentation comment.

Parameters

path req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close