The HTML specification states that checkboxes without a checkbox should not be sent by web browsers. This means that if it is not installed, the rails do not receive records about whether the check box is unchecked. This would be important, for example, if the user edited the record in which the checkbox was set, and they decided to uncheck the box - the rails would not know to update this attribute.
The hidden field has the same name as the flag, so if the flag is not sent, hidden_field is sent instead (with a value of "0", which means uncontrolled). Thus, the rails will always receive a signal about whether the flag has been checked or unchecked.
For more information on this, go to APIDock.
Rob d'apice
source share