Rails View Helper

Installation

Add this line to your application's Gemfile:

gem 'strongmind-view-helpers', require: 'strongmind/view_helpers'

Usage

Icon Helper

Tailwind CSS SafeList:

Add the following to your tailwind.config.js file to allow the following classes to be used in the Icon Helper:

safelist: [
    'aspect-square',
    'border-white',
    'bg-cyan-700',
    'shadow-md',
    'overflow-hidden',
    'rounded-full',
    'flex',
    'items-center',
    'justify-center',
]

Example:

Strongmind::ViewHelpers::IconHelper.render_profile_icon('first_name', 'last_name', 'h-9 w-9', 'border-2', 'font-semibold')