module KonoUtilsBootstrapView4::ApplicationIconHelper
Public Instance Methods
fa_icon(icon, text: nil, solid_regular:"s")
click to toggle source
# File lib/kono_utils_bootstrap_view4/application_icon_helper.rb, line 18 def fa_icon(icon, text: nil, solid_regular:"s") icon = content_tag(:i, nil, class: "fa#{solid_regular} fa-#{icon} fa-fw") elements = [icon] unless text.blank? elements << text elements.reverse! end safe_join(elements, " ") end
icon(style, name, text = nil, html_options = {})
click to toggle source
Funzione clonata da una gemma, le fontawesome lo stiamo giĆ impostando con webpack
# File lib/kono_utils_bootstrap_view4/application_icon_helper.rb, line 6 def icon(style, name, text = nil, html_options = {}) text, html_options = nil, text if text.is_a?(Hash) content_class = "#{style} fa-#{name}" content_class << " #{html_options[:class]}" if html_options.key?(:class) html_options[:class] = content_class html = content_tag(:i, nil, html_options) html << ' ' << text.to_s unless text.blank? html end