aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-08 20:57:33 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-08 20:57:33 +0100
commit36eb1a686c831d5a14998bb9ac7cc60efa363373 (patch)
treecdaa517ecfa17da37f9d5502a30ff9e73169ca47 /actionpack/lib/action_view
parentbdf5096816d03f2bdaefd20a07a0fa562543549c (diff)
downloadrails-36eb1a686c831d5a14998bb9ac7cc60efa363373.tar.gz
rails-36eb1a686c831d5a14998bb9ac7cc60efa363373.tar.bz2
rails-36eb1a686c831d5a14998bb9ac7cc60efa363373.zip
Bring AM up to date with new rendering stack.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/lookup_context.rb5
-rw-r--r--actionpack/lib/action_view/paths.rb8
-rw-r--r--actionpack/lib/action_view/render/rendering.rb2
3 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb
index 231882185f..608f1ef818 100644
--- a/actionpack/lib/action_view/lookup_context.rb
+++ b/actionpack/lib/action_view/lookup_context.rb
@@ -64,6 +64,11 @@ module ActionView
@view_paths.find(name, key.details, prefix, partial || false, key)
end
+ def find_all(name, prefix = nil, partial = false)
+ key = details_key
+ @view_paths.find_all(name, key.details, prefix, partial || false, key)
+ end
+
def template_exists?(name, prefix = nil, partial = false)
key = details_key
@view_paths.exists?(name, key.details, prefix, partial || false, key)
diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb
index 1205d26e3b..82a9f9a13c 100644
--- a/actionpack/lib/action_view/paths.rb
+++ b/actionpack/lib/action_view/paths.rb
@@ -9,6 +9,14 @@ module ActionView #:nodoc:
METHOD
end
+ def find_all(path, details = {}, prefix = nil, partial = false, key=nil)
+ each do |resolver|
+ templates = resolver.find_all(path, details, prefix, partial, key)
+ return templates unless templates.empty?
+ end
+ []
+ end
+
def find(path, details = {}, prefix = nil, partial = false, key=nil)
each do |resolver|
if template = resolver.find(path, details, prefix, partial, key)
diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb
index d11f1fa2a7..0322d4b641 100644
--- a/actionpack/lib/action_view/render/rendering.rb
+++ b/actionpack/lib/action_view/render/rendering.rb
@@ -64,6 +64,8 @@ module ActionView
Template::Text.new(options[:text], self.formats.try(:first))
elsif options.key?(:file)
with_fallbacks { find_template(options[:file], options[:_prefix]) }
+ elsif options.key?(:_template)
+ options[:_template]
elsif options.key?(:template)
find_template(options[:template], options[:_prefix])
end