Using collection_select

hello gentlemen

could u plz give me an example for collection_select rather than
mentioning syntax for it. for example lets consider user have to select
multiple values like elective subject say it has a subject a,b,c,d,e
user can select any number of subject. gentlemen am awaiting for a reply
& have a nice day

Advance Thx

<%= select_tag options_from_collection_for_select(@people, “id”, “name”)

@people = Person.find(:all) # or some other collection of variables

and where ‘id’ and ‘name’ are both in the Person model (in the table of
people, there is for example: id int auto_increment, name varchar255,
[and more columns…] … )

and this will output:

the name of the person 1 the name of the person 2 the name of the person 3 . . .

hope it helps,


hello shai

Thx for helping i know already how to accept multiple values in html
i want to know how to do this with collection_select

advance thx
have a nice day