populate select with first_name & last_name

S

Scott Holland

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
 
P

Phrogz

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.
 
R

Robert Dober

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,498
Latest member
log5Sshell/alfa5

Latest Threads

Top