aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/error.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-12-26 23:44:51 -0800
committerwycats <wycats@gmail.com>2010-12-26 23:44:51 -0800
commit7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f (patch)
treea8970b817b89488117efbc86658b07f4738b78c4 /actionpack/lib/action_view/template/error.rb
parent6c5a3bb3125735760e92f49c3824d757ef87c61e (diff)
downloadrails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.tar.gz
rails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.tar.bz2
rails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.zip
A bunch of cleanup on the inherited template patch
Diffstat (limited to 'actionpack/lib/action_view/template/error.rb')
-rw-r--r--actionpack/lib/action_view/template/error.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb
index ff256738a9..d7d98e1dd5 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionpack/lib/action_view/template/error.rb
@@ -27,7 +27,7 @@ module ActionView
class MissingTemplate < ActionViewError #:nodoc:
attr_reader :path
- def initialize(paths, path, details, partial)
+ def initialize(paths, path, prefixes, partial, details, *)
@path = path
display_paths = paths.compact.map{ |p| p.to_s.inspect }.join(", ")
template_type = if partial
@@ -38,7 +38,11 @@ module ActionView
'template'
end
- super("Missing #{template_type} #{path} with #{details.inspect} in view paths #{display_paths}")
+ 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
end