Why does the check_box form helper generate two checkboxes, one hidden?

Viewed 4568

this code: =form_fo :store_products do |f| = f.check_box :track_inventory

creates this html:

<input name="product_group[products_attributes][0][store_products_attributes}[1342647745501][track_inventory]" type="hidden" value="0">

<input id="product_group_products_attributes_0_store_products_attributes_1342647745501_track_inventory" name="product_group[products_attributes][0][store_products_attributes][1342647745501][track_inventory]" type="checkbox" value="1">

What is the reason for the first hidden element?

1 Answers
Related