提交 7cfa6c53 编写于 作者: J Joshua Peek

Fixed template lookups from outside the rails root [#1557 state:resolved]

上级 7394d12d
......@@ -39,7 +39,7 @@ module Rescue
}
RESCUES_TEMPLATE_PATH = ActionView::PathSet::Path.new(
"#{File.dirname(__FILE__)}/templates", true)
File.join(File.dirname(__FILE__), "templates"), true)
def self.included(base) #:nodoc:
base.cattr_accessor :rescue_responses
......
......@@ -57,6 +57,10 @@ def to_s
end
end
def to_str
path.to_str
end
def ==(path)
to_str == path.to_str
end
......
......@@ -105,7 +105,7 @@ def valid_extension?(extension)
def find_full_path(path, load_paths)
load_paths = Array(load_paths) + [nil]
load_paths.each do |load_path|
file = [load_path, path].compact.join('/')
file = load_path ? "#{load_path.to_str}/#{path}" : path
return load_path, file if File.file?(file)
end
raise MissingTemplate.new(load_paths, path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册