From 4d2ae8a69914217d992ed1a7e06a5d18074ae622 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 25 Oct 2007 21:32:01 +0000 Subject: Partials also set 'object' to the default partial variable. Closes #8823. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/partials.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb index 5988083091..17556b3141 100644 --- a/actionpack/lib/action_view/partials.rb +++ b/actionpack/lib/action_view/partials.rb @@ -187,12 +187,14 @@ module ActionView def add_object_to_local_assigns!(partial_name, local_assigns, object) variable_name = partial_variable_name(partial_name) - local_assigns[variable_name] ||= - if object.is_a?(ActionView::Base::ObjectWrapper) - object.value - else - object - end || controller.instance_variable_get("@#{variable_name}") + + local_assigns[:object] ||= + local_assigns[variable_name] ||= + if object.is_a?(ActionView::Base::ObjectWrapper) + object.value + else + object + end || controller.instance_variable_get("@#{variable_name}") end end end -- cgit v1.2.3