Forum: Ruby on Rails storing and retrieving arrays in mysql using rails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6b46f4eed76df33a3ffacf87bc9f1079?d=identicon&s=25 vimal (Guest)
on 2009-03-13 13:22
(Received via mailing list)

  I have a multiple checkbox of values 1 to 7 for selecting weekdays.

  What is the possibility of storing the selected weekdays array in
  and what type of field should i create in the table for storing the
  Any suggestions???

Vimal Das
B6d7dffed1196ab1a2ac35504a0cb03c?d=identicon&s=25 Sumanth Krishna (sumi)
on 2009-03-13 13:34
(Received via mailing list)
  nothing extra tweaks are required to achieve this.

    <%= select_tag "days[]", options_for_select([ "Mon", "Tue", "Wed",
"Thu","Fri","Sat","Sun",], "Monday"),:multiple => true %>

This would ensure that your selection is stored into array "days[]".
You can store this as string into db with a delimiter of your choice
[preferably days.join(",")].

hope it was useful, else post me more details :)

On Fri, Mar 13, 2009 at 2:16 PM, vimal <>

> Regards,
> Vimal Das
> >

Thanks & Regards,
Sumanth Krishna. A
+358 40 3276564

6b46f4eed76df33a3ffacf87bc9f1079?d=identicon&s=25 vimal (Guest)
on 2009-03-13 13:44
(Received via mailing list)
Cool suggestion :)
Thanks! Sumanth
This topic is locked and can not be replied to.