Forum: Ruby on Rails Options_from_collection_for_select -> Multiple fields in dis

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dylan M. (Guest)
on 2006-01-08 09:14
(Received via mailing list)
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
Eric S. (Guest)
on 2006-01-09 00:33
(Received via mailing list)
Dylan - I asked this question recently and Mark JAmes answered;
Eric S. wrote:

 > How do you concatenate a first_name, last_name as the text method for
OFCFS? Damned if I can do it without error. Is it in the original select
for the collection?


Define an instance method in the model that returns first_name +
last_name
and use that as the text method in ofcfs.

And that works fine.
Cheers,
Eric.
This topic is locked and can not be replied to.