I have a checkbox
<%= f.check_box :anonymous %>
And my table has a column anonymous which is true or false.
Code generated in html:
<input name="comment[anonymous]" type="hidden" value="0" />
<input id="comment_anonymous" name="comment[anonymous]" type="checkbox" value="1" />
Now, for some reason when I add data it's not saving if my anonymous checkbox is checked or not.. it's not changing data in database.. All other fields gets saved except anonymous.
What can be the problem ?
form_foraround thef.check_box?<%= form_for(comment, :url => (defined?(submit_url) ? submit_url : [commentable, "comments"]), :method => :post, :id => "comment-form", :class => "form-horizontal") do |f| %>