Module: Rails::Contact::ApplicationHelper
- Defined in:
- app/helpers/rails/contact/application_helper.rb
Instance Method Summary collapse
- #contact_chip(value) ⇒ Object
-
#contact_count_label(count, capped = false) ⇒ Object
A count the backend stopped at its cap is a floor, not a total, so it renders as "10,000+".
- #contact_initials(contact) ⇒ Object
Instance Method Details
#contact_chip(value) ⇒ Object
15 16 17 |
# File 'app/helpers/rails/contact/application_helper.rb', line 15 def contact_chip(value) value.presence || "-" end |
#contact_count_label(count, capped = false) ⇒ Object
A count the backend stopped at its cap is a floor, not a total, so it renders as "10,000+". Rendering it plain reads as an exact number and is how a guessed 1,005 once sized a WhatsApp broadcast.
11 12 13 |
# File 'app/helpers/rails/contact/application_helper.rb', line 11 def contact_count_label(count, capped = false) "#{number_with_delimiter(count.to_i)}#{'+' if capped}" end |
#contact_initials(contact) ⇒ Object
4 5 6 |
# File 'app/helpers/rails/contact/application_helper.rb', line 4 def contact_initials(contact) [ contact.given_name, contact.family_name ].map { |part| part.to_s.first.to_s.upcase }.join end |