# Populate select with first\_name & last\_name

**URL:** <https://www.ruby-forum.com/t/populate-select-with-first-name-last-name/196526>\
**Category:** Ruby\
**Created:** [November 24, 2007, 3:28pm UTC](https://www.ruby-forum.com/t/populate-select-with-first-name-last-name/196526 "2007-11-24T15:28:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daborg69](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d9b06d/32.png) [@daborg69](https://www.ruby-forum.com/u/daborg69)\
**Post date:** [November 24, 2007, 3:28pm UTC](https://www.ruby-forum.com/t/populate-select-with-first-name-last-name/196526/1 "2007-11-24T15:28:56Z")

</div>

Hey,

I want to populate a select drop down form helper with FIRST NAME + LAST  
NAME.

However, these are both in separate columns in the DB - how can I join  
them together?

I can manage to populate it with just the first names, like this…

===VIEW====

\<%= select(:first\_name, :id, @guests) %\>

===CONTROLLER===

```
@guests = Guest.find(:all, :conditions => ["group_id = ? and

```

event\_id = ?", params[:id], params[:event]]).map { |u| [u.first\_name, u.id]}

Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![daborg69](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d9b06d/32.png) [@daborg69](https://www.ruby-forum.com/u/daborg69)\
**Post date:** [November 24, 2007, 5:30pm UTC](https://www.ruby-forum.com/t/populate-select-with-first-name-last-name/196526/2 "2007-11-24T17:30:39Z")

</div>

On Nov 24, 7:28 am, Scott H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want to populate a select drop down form helper with FIRST NAME + LAST  
> NAME.

Try asking this question on the Rails (web framework) group, not the  
Ruby (general programming language that Rails happens to use) group.

---

<div class="post-metadata">

**Author:** ![daborg69](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d9b06d/32.png) [@daborg69](https://www.ruby-forum.com/u/daborg69)\
**Post date:** [November 25, 2007, 12:09pm UTC](https://www.ruby-forum.com/t/populate-select-with-first-name-last-name/196526/3 "2007-11-25T12:09:56Z")

</div>

On Nov 24, 2007 5:29 PM, Phrogz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Nov 24, 7:28 am, Scott H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I want to populate a select drop down form helper with FIRST NAME + LAST  
> > NAME.
> 
> Try asking this question on the Rails (web framework) group, not the  
> Ruby (general programming language that Rails happens to use)  
> Trademark this 🙂  
> R.  
> group.
