Module: ContactsHelper

Defined in:
app/helpers/contacts_helper.rb

Overview

Copyright © 2008-2013 Michael Dvorkin and contributors.

Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php


Instance Method Summary collapse

Instance Method Details

#contact_summary(contact) ⇒ Object

Contact summary for RSS/ATOM feeds.




11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/contacts_helper.rb', line 11

def contact_summary(contact)
  summary = ['']
  summary << contact.title.titleize if contact.title?
  summary << contact.department if contact.department?
  if contact.&.name?
    summary.last += " #{t(:at)} #{contact..name}"
  end
  summary << contact.email if contact.email.present?
  summary << "#{t(:phone_small)}: #{contact.phone}" if contact.phone.present?
  summary << "#{t(:mobile_small)}: #{contact.mobile}" if contact.mobile.present?
  summary.join(', ')
end