Hi, I have a few simple rails questions: Does the check_box_tag map to an int or to a boolean field within the database? Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/4956dc68/attachment.html
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, Steve Conrad Taylor wrote:> Hi, I have a few simple rails questions: > > Does the check_box_tag map to an int or to a boolean field within the > database? > > Thanks in advance, > > -Conrad > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.385 / Virus Database: 268.4.6/323 - Release Date: 24/04/2006
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. -Conrad On 4/25/06, Stephen Bartholomew <sb@2404.co.uk> wrote:> > 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, > > Steve > > > Conrad Taylor wrote: > > Hi, I have a few simple rails questions: > > > > Does the check_box_tag map to an int or to a boolean field within the > > database? > > > > Thanks in advance, > > > > -Conrad > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > ------------------------------------------------------------------------ > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.1.385 / Virus Database: 268.4.6/323 - Release Date: > 24/04/2006 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/5ba71acf/attachment-0001.html
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. Steve Conrad Taylor wrote:> 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. > > -Conrad > > On 4/25/06, *Stephen Bartholomew* <sb@2404.co.uk <mailto:sb@2404.co.uk>> > wrote: > > 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, > > Steve > > > Conrad Taylor wrote: > > Hi, I have a few simple rails questions: > > > > Does the check_box_tag map to an int or to a boolean field within > the > > database? > > > > Thanks in advance, > > > > -Conrad > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > ------------------------------------------------------------------------ > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.1.385 / Virus Database: 268.4.6/323 - Release Date: > 24/04/2006 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.385 / Virus Database: 268.4.6/323 - Release Date: 24/04/2006