Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 7857e42103ca1ab9e8d7f363527ddb2af3e8bd65 2 parents 47b4fa4 + ec38c84
@dhh dhh authored
View
2  actionpack/lib/action_view/partials.rb
@@ -181,7 +181,7 @@ def render_partial_collection(options = {}) #:nodoc:
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
2  actionpack/test/fixtures/test/_customer.erb
@@ -1 +1 @@
-Hello: <%= customer.name %>
+Hello: <%= customer.name rescue "Anonymous" %>
View
4 actionpack/test/template/render_test.rb
@@ -115,6 +115,10 @@ def test_render_partial_with_nil_collection_should_return_nil
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
Please sign in to comment.
Something went wrong with that request. Please try again.