{"action":"opened","issue":{"url":"https://api.github.com/repos/bootstrap-ruby/rails-bootstrap-forms/issues/197","labels_url":"https://api.github.com/repos/bootstrap-ruby/rails-bootstrap-forms/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/bootstrap-ruby/rails-bootstrap-forms/issues/197/comments","events_url":"https://api.github.com/repos/bootstrap-ruby/rails-bootstrap-forms/issues/197/events","html_url":"https://github.com/bootstrap-ruby/rails-bootstrap-forms/issues/197","id":56447735,"number":197,"title":"collection_check_boxes adds a hidden element to the form","user":{"login":"arpitadhundia","id":10817527,"avatar_url":"https://avatars.githubusercontent.com/u/10817527?v=3","gravatar_id":"","url":"https://api.github.com/users/arpitadhundia","html_url":"https://github.com/arpitadhundia","followers_url":"https://api.github.com/users/arpitadhundia/followers","following_url":"https://api.github.com/users/arpitadhundia/following{/other_user}","gists_url":"https://api.github.com/users/arpitadhundia/gists{/gist_id}","starred_url":"https://api.github.com/users/arpitadhundia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arpitadhundia/subscriptions","organizations_url":"https://api.github.com/users/arpitadhundia/orgs","repos_url":"https://api.github.com/users/arpitadhundia/repos","events_url":"https://api.github.com/users/arpitadhundia/events{/privacy}","received_events_url":"https://api.github.com/users/arpitadhundia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-03T22:27:07Z","updated_at":"2015-02-03T22:27:07Z","closed_at":null,"body":"The following piece of code worked perfectly on bootstrap_form v2.1.1:-\r\n<%= f.collection_check_boxes :steps, Event::steps, :name, :display, :label => 'Steps' %>\r\n\r\nBut after upgrading to v2.0, I see that the colelction_check_boxes adds a hidden element to my form, here is the html for it:-\r\n<input value=\"\" multiple=\"multiple\" type=\"hidden\" name=\"wizard_create_event_base_order_settings_form[steps][]\" id=\"wizard_create_event_base_order_settings_form_steps\">\r\n\r\nNow on form submission, there is an extra element in the array that represents this collection. Basically even though I have 6 checkboxes checked, on form submission my array has 7 elements with the first one having empty value.\r\n\r\nI also looked at the code and noticed that the implementation for collection_check_boxes has been changed to add the hidden_field.\r\n\r\ndef collection_check_boxes(*args)\r\n      html = inputs_collection(*args) do |name, value, options|\r\n        options[:multiple] = true\r\n        check_box(name, options, value, nil)\r\n      end\r\n      hidden_field(args.first,{value: \"\", multiple: true}).concat(html)\r\n end\r\n\r\nCould someone elaborate on why this change has been made?\r\n\r\nThanks!"}}