instance method template_glob

Ruby on Rails 7.2.3

Since v7.0.10 Private

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

template_glob(glob)

Safe glob within @path

Parameters

glob req
Source
# File actionview/lib/action_view/template/resolver.rb, line 196
      def template_glob(glob)
        query = File.join(escape_entry(@path), glob)
        path_with_slash = File.join(@path, "")

        Dir.glob(query).filter_map do |filename|
          filename = File.expand_path(filename)
          next if File.directory?(filename)
          next unless filename.start_with?(path_with_slash)

          filename
        end
      end

Defined in actionview/lib/action_view/template/resolver.rb line 196 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::FileSystemResolver

Type at least 2 characters to search.

↑↓ navigate · open · esc close