diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-25 21:32:01 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-25 21:32:01 +0000 |
commit | 4d2ae8a69914217d992ed1a7e06a5d18074ae622 (patch) | |
tree | ae0f6eed499ef3d6f5ec91092d3f8ddc34a98bf2 /actionpack/lib | |
parent | cb1aab05528b98fb534c400b1dbe09a540a4436c (diff) | |
download | rails-4d2ae8a69914217d992ed1a7e06a5d18074ae622.tar.gz rails-4d2ae8a69914217d992ed1a7e06a5d18074ae622.tar.bz2 rails-4d2ae8a69914217d992ed1a7e06a5d18074ae622.zip |
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
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/partials.rb | 14 |
1 files changed, 8 insertions, 6 deletions
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 |