Module: Strongmind::ViewHelpers::IconHelper

Defined in:
lib/strongmind/view_helpers/icon_helper.rb

Class Method Summary collapse

Class Method Details

.render_profile_icon(first_name, last_name, size_classes, border_size_class, font_classes) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/strongmind/view_helpers/icon_helper.rb', line 8

def self.render_profile_icon(first_name, last_name, size_classes, border_size_class, font_classes)
  initials = first_name.first + last_name.first
  classes = "aspect-square #{size_classes} #{border_size_class} border-white bg-cyan-700 shadow-md overflow-hidden rounded-full flex items-center justify-center"
  "<div title=\"#{"#{first_name} #{last_name}"}\" class=\"#{classes}\">
  <div class=\"text-white #{font_classes}\">#{initials.upcase}</div>
</div>"
end