name doesn't have to be a field -- it can be an an attribute (function)
on your model:
def name
company.blank? ? lastname : company
end
oldlibmike wrote:
> I have a table in my application for Contacts that has company,
> lastname and firstname fields.
> I would like to use a 'virtual field' as the name=true field in the
> model.
> If the company is present, I want to use that field, otherwise I want
> to use lastname ||, || firstname.
>
> Is there a way to do this conditionally in rails and/or hobo?
>
> Thanks!
> Mike
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---