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

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.
Dylan M. (Guest)
on 2006-01-08 09:14
(Received via mailing list)
Rails mailing list
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 +
and use that as the text method in ofcfs.

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