Forum: Ruby on Rails collection_select returning multiple values

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
16d9fc0cda9ae97ed3746c8eba47c6cc?d=identicon&s=25 Rúben Cabaço (Guest)
on 2006-04-20 21:55
(Received via mailing list)
Hey,



Is is possible to make collection_select return multiple values? If yes,
how
can it be done?



IÂ?ve tried:

<%= collection_select("group[]", "id", @groups, "id", "name",
{},{:multiple
=> true}) %>

Leading to:

You have a nil object when you didn't expect it!

You might have expected an instance of ActiveRecord::Base.

The error occured while evaluating nil.id_before_type_cast



The @groups is Group.find(:all).



Can anyone help?



Thanks in advance,

Rúben Cabaço
This topic is locked and can not be replied to.