On Apr 17, 5:20 am, Naveen Naveen
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I had given like
>
> Java<%=check_box_tag "employees", "skills[]",
"Java" %>
> Rails<%=check_box_tag "employees", "skills[]",
"Rails" %>
> C<%=check_box_tag "employees", "skills[]",
"C" %>
>
> since it belongs to the "employee" object. So both the checkboxes
(Java
> and Rails) are selected in the "new" page.
>
> In the controller, I had given
>
> @employees = Employees.new(@params[''employees''])
> @employees.save
>
> Also in the DB, I am having a table called as "employees" and in
that
> "skills" is a column.
>
> Is it possible in DB to have a single column "skills" for
multiple
> checkboxes
> (Java, Rails and C)
>
Well ActiveRecord will serialize stuff into a single column (see the
serialize method), but typically the way you would do this would be to
have a skills table and then a has many through between employees and
skills.
Fred> Could you please suggest what needs to be done.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---