aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/render/partials.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-08-11 15:02:05 -0700
committerYehuda Katz <wycats@gmail.com>2009-08-15 12:32:01 -0700
commit27adcd1c1a5cc566cfa8c5f8268b65ef01a7e865 (patch)
tree2e732c3909ec5a6a72e3dbcace8d0fdd2d57cc3d /actionpack/lib/action_view/render/partials.rb
parenta363dba790d9d9f6284f7f857d872eca124805ee (diff)
downloadrails-27adcd1c1a5cc566cfa8c5f8268b65ef01a7e865.tar.gz
rails-27adcd1c1a5cc566cfa8c5f8268b65ef01a7e865.tar.bz2
rails-27adcd1c1a5cc566cfa8c5f8268b65ef01a7e865.zip
Clean up ActionView some:
* Call _evaluate_assigns_and_ivars at the two entry points so we don't have to do a check at every render. * Make template.render viable without having to go through a wrapper method * Remove old TemplateHandler#render(template, local_assigns) path so we don't have to set self.template every time we render a template. * Move Template rescuing code to Template#render so it gets caught every time. * Pull in some tests from Pratik that test render @object in ActionView
Diffstat (limited to 'actionpack/lib/action_view/render/partials.rb')
-rw-r--r--actionpack/lib/action_view/render/partials.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb
index 83175ab4cf..e287021eb1 100644
--- a/actionpack/lib/action_view/render/partials.rb
+++ b/actionpack/lib/action_view/render/partials.rb
@@ -265,7 +265,9 @@ module ActionView
@locals[:object] = @locals[template.variable_name] = object
@locals[@options[:as]] = object if @options[:as]
- content = @view._render_single_template(template, @locals, &@block)
+ content = template.render(@view, @locals) do |*names|
+ @view._layout_for(names, &@block)
+ end
return content if @block || !@options[:layout]
find_template(@options[:layout]).render(@view, @locals) { content }
end
@@ -302,7 +304,7 @@ module ActionView
end
def render_partial(options)
- @assigns_added = false
+ _evaluate_assigns_and_ivars
# TODO: Handle other details here.
self.formats = options[:_details][:formats] if options[:_details]
_render_partial(options)