Permalink
Browse files

Fixed template lookups from outside the rails root [#1557 state:resol…

…ved]
  • Loading branch information...
1 parent 7394d12 commit 7cfa6c535bc54f16a3fc7fa39969d4410de3e483 @josh josh committed Dec 11, 2008
View
2 actionpack/lib/action_controller/rescue.rb
@@ -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
View
4 actionpack/lib/action_view/paths.rb
@@ -57,6 +57,10 @@ def to_s
end
end
+ def to_str
+ path.to_str
+ end
+
def ==(path)
to_str == path.to_str
end
View
2 actionpack/lib/action_view/template.rb
@@ -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)

0 comments on commit 7cfa6c5

Please sign in to comment.