Class: ActionView::PathSet

Inherits:
Array show all
Defined in:
actionpack/lib/action_view/paths.rb

Overview

Action View PathSet

Instance Method Summary (collapse)

Methods inherited from Array

#as_json, #encode_json, #extract_options!, #fifth, #forty_two, #fourth, #from, #in_groups, #in_groups_of, #sample, #second, #split, #third, #to, #to_formatted_s, #to_param, #to_query, #to_sentence, #to_xml, #uniq_by, #uniq_by!, wrap

Instance Method Details

- (Boolean) exists?(*args)

Returns:

  • (Boolean)


27
28
29
# File 'actionpack/lib/action_view/paths.rb', line 27

def exists?(*args)
  find_all(*args).any?
end

- (Object) find(path, prefix = nil, partial = false, details = {}, key = nil)

Raises:



13
14
15
16
17
# File 'actionpack/lib/action_view/paths.rb', line 13

def find(path, prefix = nil, partial = false, details = {}, key = nil)
  template = find_all(path, prefix, partial, details, key).first
  raise MissingTemplate.new(self, "#{prefix}/#{path}", details, partial) unless template
  template
end

- (Object) find_all(*args)



19
20
21
22
23
24
25
# File 'actionpack/lib/action_view/paths.rb', line 19

def find_all(*args)
  each do |resolver|
    templates = resolver.find_all(*args)
    return templates unless templates.empty?
  end
  []
end