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

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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.