I have an object: @object
with tons of boolean fields.
now. according to the HTML spec, if a checkbox isn’t checked, the value isn’t sent.
Which is a problem… cause I need that information.
How do I get around that? the api for f.check_box suggests fields_for… http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M002298
but I couldn’t figure out the syntax for @object.is_admin
=\
currently, without changing anything: i have this:
<% form_for @object do |f| %>
<td><%= f.check_box :allow_downloads, :label => false %></td>
.
.
.
error : undefined methodto_i’ for #`
The problem was that my was accessing the wrong controller. I moved my form to a proper view (made more sense for usability, anyway) and it works.