Class: ActionView::PathSet

Inherits:
Object
  • Object
show all
Defined in:
lib/phenomenal_rails/path_set.rb

Instance Method Summary collapse

Instance Method Details

#find(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/phenomenal_rails/path_set.rb', line 4

def find(*args)
  templates = find_all(*args)
  if templates.empty?
    if find_all_inactive(*args).empty?
      raise(MissingTemplate.new(self, *args))
    else
      ActionView::Template::Text.new("","text")
    end
  else
    templates.first || raise(MissingTemplate.new(self, *args))
  end
end