From 581b2b68368e3330cc725a305d0e2465c2e71e1c Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Fri, 8 Oct 2010 11:12:11 +1300 Subject: fix rendering a partial with an array as its :object [#5746 state:resolved] Signed-off-by: Michael Koziarski Conflicts: actionpack/lib/action_view/render/partials.rb --- actionpack/test/fixtures/test/_object_inspector.erb | 1 + actionpack/test/template/render_test.rb | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 actionpack/test/fixtures/test/_object_inspector.erb (limited to 'actionpack/test') diff --git a/actionpack/test/fixtures/test/_object_inspector.erb b/actionpack/test/fixtures/test/_object_inspector.erb new file mode 100644 index 0000000000..53af593821 --- /dev/null +++ b/actionpack/test/fixtures/test/_object_inspector.erb @@ -0,0 +1 @@ +<%= object_inspector.inspect -%> \ No newline at end of file diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 205fdcf345..756d8d05d2 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -127,6 +127,10 @@ module RenderTestCases assert_equal "Hello: david", @view.render(:partial => "test/customer", :object => Customer.new("david")) end + def test_render_object_with_array + assert_equal "[1, 2, 3]", @view.render(:partial => "test/object_inspector", :object => [1, 2, 3]) + end + def test_render_partial_collection assert_equal "Hello: davidHello: mary", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), Customer.new("mary") ]) end -- cgit v1.2.3