From 87ec72bd8c4b5d178ba7a41e605bc9a8e27f9e67 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 2 May 2008 10:45:08 +0100 Subject: Improve PartialTemplate tests --- actionpack/lib/action_view/base.rb | 4 +--- actionpack/lib/action_view/partial_template.rb | 10 ++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index bfd1a0ee0d..17260f09c5 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -242,9 +242,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn END_ERROR end - template = Template.new(self, template_path, use_full_path, local_assigns) - - render_template(template) + Template.new(self, template_path, use_full_path, local_assigns).render_template end # Renders the template present at template_path (relative to the view_paths array). diff --git a/actionpack/lib/action_view/partial_template.rb b/actionpack/lib/action_view/partial_template.rb index ffcf258afe..1fb3aaee02 100644 --- a/actionpack/lib/action_view/partial_template.rb +++ b/actionpack/lib/action_view/partial_template.rb @@ -24,10 +24,12 @@ module ActionView #:nodoc: def render_member(object) @locals[@counter_name] += 1 @locals[:object] = @locals[@variable_name] = object - returning render_template do - @locals.delete(@variable_name) - @locals.delete(:object) - end + + template = render_template + @locals.delete(@variable_name) + @locals.delete(:object) + + template end def counter=(num) -- cgit v1.2.3