By default simple_form - collection_check_boxes displays hidden_field at the end

Viewed 3865

I am using simple_form's collection_check_boxes in my new.html.erb. By default, when the html is rendered, it adds hidden field at the end due to which at controller side I get array of values with last element as "". Can anyone please help me how can I prevent the hidden field to be rendered on View?

new.html.erb :

<%= f.collection_check_boxes :topic_id, Topic.all, :id, :name %>
<%= f.button :submit %>

I used Firebug to inspect my checkboxes element and following was the outcome :

    <span>
    <span>
    <input type="hidden" value="" name="revision[topic_id][]">
    <input class="btn" type="submit" value="Create Revision" name="commit">

I want to remove the above hidden field. Please help.

2 Answers
Related