Forum: Ruby on Rails Filling Dropdowns with 2 database columns

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
gelpimp (Guest)
on 2007-03-17 08:46
(Received via mailing list)

new to the whole rails thing, new to the group, too.  please forgive
me if i'm asking this in the wrong place.  if so, please direct me to
the proper place.

this seems to be extremely basic, but it is early in the morning, and
i can't seem to figure it out:

i would like to fill a 'name' dropdown list with the standard
firstname lastname concatenation of two database columns.

<%= select("card", "player_id", Player.find(:all).collect{|p|
[p.lastname,]}) %>

this seems to fill the lastname just fine, though obviously all i give
it is p.lastname.  how would i get both first and last name to show?

thanks in advance.  again my apologies if i posted this out of place.
This topic is locked and can not be replied to.