Class: ActionView::OptimizedFileSystemResolver

Inherits:
FileSystemResolver show all
Defined in:
lib/action_view/template/resolver.rb

Overview

An Optimized resolver for Rails’ most common case.

Constant Summary

Constants inherited from PathResolver

PathResolver::DEFAULT_PATTERN, PathResolver::EXTENSIONS

Instance Method Summary collapse

Methods inherited from FileSystemResolver

#eql?, #initialize, #to_s

Methods inherited from PathResolver

#initialize

Methods inherited from Resolver

#clear_cache, #find_all, #find_all_anywhere, #initialize

Constructor Details

This class inherits a constructor from ActionView::FileSystemResolver

Instance Method Details

#build_query(path, details) ⇒ Object

:nodoc:



271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/action_view/template/resolver.rb', line 271

def build_query(path, details)
  exts = EXTENSIONS.map { |ext| details[ext] }

  if path.to_s.starts_with? @path.to_s
    query = escape_entry(path)
  else
    query = escape_entry(File.join(@path, path))
  end

  query + exts.map { |ext|
    "{#{ext.compact.uniq.map { |e| ".#{e}," }.join}}"
  }.join
end