Forum: Ruby on Rails collection_select

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.
Pingu P. (Guest)
on 2007-05-10 20:31
hey, i have a model called continents, that has a name and an id, anyone
know why this doesnt work

<%= collection_select(:continent, :name, @continents, :id, :name),

but this does

<%= collection_select(:continent, :id, @continents, :id, :name), many
thanks

The first results in a:

undefined method `name' for #<Array:0x22cff08>

Thankyou.
Pingu P. (Guest)
on 2007-05-10 21:17
Fixed it myself, i actually put the correct code in this post, in my
app, i had @continent, instead of @continents, didnt realise it was
plural sensitive.
This topic is locked and can not be replied to.