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.
Eric S. (Guest)
on 2005-12-30 09: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.
Mark Reginald J. (Guest)
on 2005-12-30 12:03
(Received via mailing list)
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.

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