Exception: ActionView::MissingTemplate

Inherits:
ActionViewError show all
Defined in:
lib/action_view/template/error.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths, path, prefixes, partial, details) ⇒ MissingTemplate

Returns a new instance of MissingTemplate.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/action_view/template/error.rb', line 31

def initialize(paths, path, prefixes, partial, details, *)
  @path = path
  prefixes = Array.wrap(prefixes)
  display_paths = paths.compact.map{ |p| p.to_s.inspect }.join(", ")
  template_type = if partial
    "partial"
  elsif path =~ /layouts/i
    'layout'
  else
    'template'
  end

  searched_paths = prefixes.map { |prefix| [prefix, path].join("/") }

  out  = "Missing #{template_type} #{searched_paths.join(", ")} with #{details.inspect}. Searched in:\n"
  out += paths.compact.map { |p| "  * #{p.to_s.inspect}\n" }.join
  super out
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



29
30
31
# File 'lib/action_view/template/error.rb', line 29

def path
  @path
end