From 175ba04cf38134e156208c7e59808c40e8c25aa5 Mon Sep 17 00:00:00 2001 From: "Daniel Fox, Grant Hutchins & Trace Wax" Date: Fri, 2 Nov 2012 14:47:35 -0700 Subject: Support :multiple option on input tags with :index When you have an explicit index set, then when you build an input tag with :multiple => true, it doesn't add [] to the end of its name, although it should. --- actionpack/test/template/form_helper_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index fbfc73deda..c730e3ab74 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -525,6 +525,19 @@ class FormHelperTest < ActionView::TestCase ) end + def test_check_box_with_multiple_behavior_and_index + @post.comment_ids = [2,3] + assert_dom_equal( + '', + check_box("post", "comment_ids", { :multiple => true, :index => "foo" }, 1) + ) + assert_dom_equal( + '', + check_box("post", "comment_ids", { :multiple => true, :index => "bar" }, 3) + ) + + end + def test_checkbox_disabled_disables_hidden_field assert_dom_equal( '', -- cgit v1.2.3