Thanks Matt, that's great to know.

So, in the very simplest manner I've put this into my model:

def name
        title + " " + first_name + " " + middle_name + " " + last_name + "
" + suffix
end

This works pretty good .... of course when I have an empty field (like
middle name for instance) then I end up with one extra " " per
"name" ... so I'll need to add some conditionals to this.

thanks again.
--jeremy

On May 24, 12:46 pm, Matt Jones <[email protected]> wrote:
> On Mon, May 24, 2010 at 12:38 PM, Jeremy Savoy <[email protected]> wrote:
> > I have a "contact" model that stores the title, first name, middle
> > name, last name, and suffix of each contact in separate fields. This
> > is done for sorting contacts by any of those values as well as
> > statistics (male vs female, etc).
>
> > I would like to have a controller action that combines these five
> > fields into a meta-field called "name" that could then be used just
> > like any other field in my "contacts" model, i.e. in table-plus, the
> > view page of each contact, or wherever I see the need.
>
> For display purposes, simply defining a method 'name' on the model
> that combines them should work; Hobo will pretty much work with
> anything in a fields-list call that is a method.
>
> --Matt Jones
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to