module ParentsHelper
Public Instance Methods
Source
# File app/helpers/parents_helper.rb, line 14 def format_parent_with_relationship(parent_relationship, include_phone: true) parent = parent_relationship.parent safe_join( [ parent_relationship.label_with_parent, if (email = parent.email).present? tag.span(email, class: "nhsuk-u-secondary-text-colour") end, if include_phone && (phone = parent.phone).present? tag.span(phone, class: "nhsuk-u-secondary-text-colour") end ].compact, tag.br ) end
Source
# File app/helpers/parents_helper.rb, line 4 def format_parents_with_relationships(parent_relationships) tag.ul(class: "nhsuk-list") do safe_join( parent_relationships.map do |parent_relationship| tag.li { format_parent_with_relationship(parent_relationship) } end ) end end