class ActionView::MissingTemplate

def initialize(paths, path, prefixes, partial, details, *)

def initialize(paths, path, prefixes, partial, details, *)
  if partial && path.present?
    path = path.sub(%r{([^/]+)$}, "_\\1")
  end
  @path = path
  @paths = paths
  @prefixes = Array(prefixes)
  @partial = partial
  template_type = if partial
    "partial"
  elsif /layouts/i.match?(path)
    "layout"
  else
    "template"
  end
  searched_paths = @prefixes.map { |prefix| [prefix, path].join("/") }
  out  = "Missing #{template_type} #{searched_paths.join(", ")} with #{details.inspect}.\n\nSearched in:\n"
  out += paths.compact.map { |p| "  * #{p.to_s.inspect}\n" }.join
  super out
end