aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/paths.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-23 15:58:38 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 11:49:11 -0700
commitcecafc52ee0a4a53c903ddbaba95683261f88e5f (patch)
tree4cc1f0d246a313b2a2fa78747b3265bdbd901c22 /actionpack/lib/action_view/paths.rb
parentda3c21ead59cb47b8f4c69c6bd95f225a9c8b479 (diff)
downloadrails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.gz
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.tar.bz2
rails-cecafc52ee0a4a53c903ddbaba95683261f88e5f.zip
Refactor ActionView::Template
ActionView::Template is now completely independent from template storage, which allows different back ends such as the database. ActionView::Template's only responsibility is to take in the template source (passed in from ActionView::Path), compile it, and render it.
Diffstat (limited to 'actionpack/lib/action_view/paths.rb')
-rw-r--r--actionpack/lib/action_view/paths.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb
index e48088f344..f6d021c92a 100644
--- a/actionpack/lib/action_view/paths.rb
+++ b/actionpack/lib/action_view/paths.rb
@@ -3,7 +3,7 @@ module ActionView #:nodoc:
def self.type_cast(obj)
if obj.is_a?(String)
cache = !Object.const_defined?(:Rails) || Rails.configuration.cache_classes
- Template::FileSystemPath.new(obj, :cache => cache)
+ Template::FileSystemPathWithFallback.new(obj, :cache => cache)
else
obj
end
@@ -34,18 +34,18 @@ module ActionView #:nodoc:
end
def find_by_parts(path, details = {}, prefix = nil, partial = false)
- template_path = path.sub(/^\//, '')
+ # template_path = path.sub(/^\//, '')
+ template_path = path
each do |load_path|
if template = load_path.find_by_parts(template_path, details, prefix, partial)
return template
end
end
-
- Template.new(path, self)
- rescue ActionView::MissingTemplate => e
+
+ # TODO: Have a fallback absolute path?
extension = details[:formats] || []
- raise ActionView::MissingTemplate.new(self, "#{prefix}/#{path}.{#{extension.join(",")}}")
+ raise ActionView::MissingTemplate.new(self, "#{prefix}/#{path} - #{details.inspect} - partial: #{!!partial}")
end
def find_by_parts?(path, extension = nil, prefix = nil, partial = false)