Fixed issue with FA icon in ApplicationHelper

• Fixed:
- issue with FA icon in ApplicationHelper
This commit is contained in:
mgabdev 2021-01-19 00:35:51 -05:00
parent 90b752c91d
commit 6354007875

View File

@ -49,10 +49,10 @@ module ApplicationHelper
policy(record).public_send("#{action}?") policy(record).public_send("#{action}?")
end end
def fa_icon(icon, attributes = {}) def fa_icon(icon="", attributes = {})
class_names = attributes[:class]&.split(' ') || [] class_names = attributes[:class]&.split(' ') || []
class_names << 'fa' 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(' '))) content_tag(:i, nil, attributes.merge(class: class_names.join(' ')))
end end