Class: InheritedTemplates::ActionView::Base::PathSet

Inherits:
ActionView::PathSet
  • Object
show all
Defined in:
lib/inherited_templates/action_view/base.rb

Instance Method Summary collapse

Instance Method Details

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



15
16
17
18
19
20
21
# File 'lib/inherited_templates/action_view/base.rb', line 15

def find(path, prefix = nil, partial = false, details = {}, key = nil)
  begin
    super
  rescue ::ActionView::MissingTemplate
    super(path, "defaults", partial, details, key)
  end
end

#find_template(original_template_path, format = nil, html_fallback = true) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/inherited_templates/action_view/base.rb', line 23

def find_template(original_template_path, format = nil, html_fallback = true)
  begin
    super
  rescue ::ActionView::MissingTemplate
    original_template_path.sub!(/^[\w]+/, "defaults")
    super
  end
end