Forum: Ruby on Rails Render a Drop Down

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.
34cffdd22d8d650839a8aa038cecefdf?d=identicon&s=25 Matt Ryan (mattmate)
on 2007-04-04 12:31
Hey all,

I was just wondering how I would render the following dropdown.

Contact Model

  def full_name
    self.Firstname + ' ' + self.Lastname

Inside the view I would like to produce a DropDown list that will have
the Firstname + Lastname displayed with the id as the value. I have
tried a few methods and cannot seem to find a way.

5030981121b21bed8aee074f68bd5074?d=identicon&s=25 Russell Norris (Guest)
on 2007-04-04 15:51
(Received via mailing list)
There's a couple of different options you have.
options_from_collection_for_select or select, itself. You might want to
over the API []
to see which one suits your needs best but it looks like either of
will get you where you need.

This topic is locked and can not be replied to.