1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge branch 'master' of git@github.com:rails/rails

This commit is contained in:
David Heinemeier Hansson 2008-10-30 21:11:46 +01:00
commit 7857e42103
3 changed files with 6 additions and 2 deletions

View file

@ -181,7 +181,7 @@ module ActionView
ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
template = _pick_partial_template(_partial_path)
local_assigns[template.counter_name] = index
result = template.render_partial(self, object, local_assigns, as)
result = template.render_partial(self, object, local_assigns.dup, as)
index += 1
result
end.join(spacer)

View file

@ -1 +1 @@
Hello: <%= customer.name %>
Hello: <%= customer.name rescue "Anonymous" %>

View file

@ -115,6 +115,10 @@ class ViewRenderTest < Test::Unit::TestCase
assert_nil @view.render(:partial => "test/customer", :collection => nil)
end
def test_render_partial_with_nil_values_in_collection
assert_equal "Hello: davidHello: Anonymous", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), nil ])
end
def test_render_partial_with_empty_array_should_return_nil
assert_nil @view.render(:partial => [])
end