Simple Rails Question


Hi, I have a few simple rails questions:

Does the check_box_tag map to an int or to a boolean field within the

Thanks in advance,



check_box will use a 1 or 0 for checked/unchecked. The db field can be
a char, int or boolean (if the db supports it).

In a view displaying products for example:

<%= check_box(‘product’, ‘available’) %>

where ‘available’ is a field in the ‘products’ table.

Hope this helps,



Hi, what’s difference between using check_box and check_box_tag? Just
curious as to what one should use in development. Well, I must go and
thanks for the information.



check_box is used to map to a model attribute (like ‘available’ in the
‘product’ model)

check_box_tag creates a checkbox from the options you give.