diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 17 | ||||
-rw-r--r-- | actionpack/lib/action_view/paths.rb | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index af13f2cd3e..07ef3f2140 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -6,15 +6,20 @@ module ActionView #:nodoc: end class MissingTemplate < ActionViewError #:nodoc: - attr_reader :path, :action_name + attr_reader :path - def initialize(paths, path, template_format = nil) + def initialize(paths, path, details, partial) @path = path - @action_name = path.split("/").last.split(".")[0...-1].join(".") - full_template_path = path.include?('.') ? path : "#{path}.erb" display_paths = paths.compact.join(":") - template_type = (path =~ /layouts/i) ? 'layout' : 'template' - super("Missing #{template_type} #{full_template_path} in view path #{display_paths}") + template_type = if partial + "partial" + elsif path =~ /layouts/i + 'layout' + else + 'template' + end + + super("Missing #{template_type} #{path} with #{details.inspect} in view path #{display_paths}") end end diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb index 0059b79e5f..6e55d69d00 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -45,7 +45,7 @@ module ActionView #:nodoc: end end - raise ActionView::MissingTemplate.new(self, "#{prefix}/#{path} - #{details.inspect} - partial: #{!!partial}") + raise ActionView::MissingTemplate.new(self, "#{prefix}/#{path}", details, partial) end def exists?(path, extension = nil, prefix = nil, partial = false) |