diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ca04d913..8f901b5c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,10 +49,10 @@ module ApplicationHelper policy(record).public_send("#{action}?") end - def fa_icon(icon, attributes = {}) + def fa_icon(icon="", attributes = {}) class_names = attributes[:class]&.split(' ') || [] class_names << 'fa' - # class_names += icon.split(' ').map { |cl| "fa-#{cl}" } + class_names += "#{icon}".split(' ').map { |cl| "fa-#{cl}" } content_tag(:i, nil, attributes.merge(class: class_names.join(' '))) end