sorry, don’t have the time to go into details right now, but maybe
that’ll help you a bit:
<%= select_tag “client[branch][]”,
options_for_select([[‘Automatisering’,‘1’],
[‘Bouwnijverheid’, ‘2’],
[‘Communicatie Intern’, ‘3’], [‘Communicatie
Extern’, ‘4’], [‘Cultuur’, ‘5’],
[‘Detailhandel food’, ‘6’], [‘Detailhandel non
food’, ‘7’], [‘Drukkerij’, ‘8’],
[‘Facilitaire dienst’, ‘9’], [‘Financiele
dienstverlener’, ‘10’],
[‘Gezondheidszorg’, ‘11’],
[‘Handel’, ‘12’],
[‘Industrie’, ‘13’], [‘IT’, ‘14’],
[‘Mediabureau’, ‘15’],
[‘Overheid’, ‘16’], [‘Onderwijs’, ‘17’],
[‘Onderzoek’, ‘18’],
[‘Reclamebureau’, ‘19’], [‘Recreatie &
toerisme’, ‘20’],
[‘Telecom’, ‘21’], [‘Transport sector’, ‘22’],
[‘Uitgeverij dag-en weekbladen’, ‘23’],
[‘Uitgeverij publieksbladen’, ‘24’], [‘Uitgeverij vakbladen’, ‘25’],
[‘Uitgeverij relatiemagazines’, ‘26’],
[‘Zakelijk adviesbureau’, ‘27’], [‘Overig’,
‘28’]], @client.branch), :multiple => true, :size => 7, :id =>
“client_branch” %>
in this case @client.branch holds an array of ids that are selected, but
could be a single element too
options_from_collection_for_select may be another alternative and the
“choices” parameter of form.select works just the same as
options_for_select