Exception: ActionView::MissingTemplate
- Inherits:
-
ActionViewError
- Object
- StandardError
- ActionViewError
- ActionView::MissingTemplate
- Defined in:
- actionview/lib/action_view/template/error.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(paths, path, prefixes, partial, details) ⇒ MissingTemplate
constructor
A new instance of MissingTemplate.
Constructor Details
#initialize(paths, path, prefixes, partial, details) ⇒ MissingTemplate
Returns a new instance of MissingTemplate.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'actionview/lib/action_view/template/error.rb', line 33 def initialize(paths, path, prefixes, partial, details, *) @path = path prefixes = Array(prefixes) template_type = if partial "partial" elsif path =~ /layouts/i 'layout' else 'template' end if partial && path.present? path = path.sub(%r{([^/]+)$}, "_\\1") 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
#path ⇒ Object (readonly)
Returns the value of attribute path
31 32 33 |
# File 'actionview/lib/action_view/template/error.rb', line 31 def path @path end |