Forum: Ruby on Rails NewbieQ concatenating name in options_from_collection_for_se

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.
17d01ff4326c26911481c7a77283b343?d=identicon&s=25 Eric Sloane (Guest)
on 2005-12-30 08:49
(Received via mailing list)
Hi,
A real dumb one :~/
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?
Eric.
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2005-12-30 11:03
(Received via mailing list)
Eric Sloane 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.

--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.