# Collection\_select

**URL:** <https://www.ruby-forum.com/t/collection-select/103825>\
**Category:** Rails\
**Created:** [May 10, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/collection-select/103825 "2007-05-10T18:31:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pingu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9a28c/32.png) [@pingu](https://www.ruby-forum.com/u/pingu)\
**Post date:** [May 10, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/collection-select/103825/1 "2007-05-10T18:31:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pingu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9a28c/32.png) [@pingu](https://www.ruby-forum.com/u/pingu)\
**Post date:** [May 10, 2007, 7:17pm UTC](https://www.ruby-forum.com/t/collection-select/103825/2 "2007-05-10T19:17:43Z")

</div>

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.
