Forum: Ruby on Rails store multiple checkbox values in single column of table

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3c968ea5867bcb0685c1b1b5a6cbfdd1?d=identicon&s=25 mack gille (mackgille)
on 2013-08-05 13:09
hi all,
  i need to store multiple checkbox values in single column of a table.
here is my short code https://github.com/Kumar2013hk/check.git .Please
help me in this regard..
14b5582046b4e7b24ab69b7886a35868?d=identicon&s=25 Joel Pearson (virtuoso)
on 2013-08-05 15:56
If you want to store multiple on/off switches together, then Binary is
your friend.

No, Yes, No, No, Yes, Yes, No
0100110
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2013-08-05 16:10
(Received via mailing list)
On 5 August 2013 12:09, mack gille <lists@ruby-forum.com> wrote:
> hi all,
>   i need to store multiple checkbox values in single column of a table.
> here is my short code https://github.com/Kumar2013hk/check.git .Please
> help me in this regard..

googling for
rails bitfield
provides a number of hits, though I have no personal experience of the
suggestions.

First, though, don't bother unless you have a good reason.  Just have
a column per boolean.  Adopt the KISS technique.

Colin
This topic is locked and can not be replied to.