Populate select with first_name & last_name

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

···

--
Posted via http://www.ruby-forum.com/.

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

···

On Nov 24, 7:28 am, Scott Holland <sc...@scottholland.com> wrote:

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

> 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 :slight_smile:
R.
group.

···

On Nov 24, 2007 5:29 PM, Phrogz <phrogz@mac.com> wrote:

On Nov 24, 7:28 am, Scott Holland <sc...@scottholland.com> wrote:

--
what do I think about Ruby?
http://ruby-smalltalk.blogspot.com/