Module: KonoUtilsBootstrapView4::ApplicationIconHelper
- Included in:
- KonoUtils::Object::Cell::Base
- Defined in:
- lib/kono_utils_bootstrap_view4/application_icon_helper.rb
Instance Method Summary collapse
- #fa_icon(icon, text: nil, solid_regular: "s") ⇒ Object
-
#icon(style, name, text = nil, html_options = {}) ⇒ Object
Funzione clonata da una gemma, le fontawesome lo stiamo già impostando con webpack.
Instance Method Details
#fa_icon(icon, text: nil, solid_regular: "s") ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# 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 = {}) ⇒ Object
Funzione clonata da una gemma, le fontawesome lo stiamo già impostando con webpack
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/kono_utils_bootstrap_view4/application_icon_helper.rb', line 6 def icon(style, name, text = nil, = {}) text, = nil, text if text.is_a?(Hash) content_class = "#{style} fa-#{name}" content_class << " #{[:class]}" if .key?(:class) [:class] = content_class html = content_tag(:i, nil, ) html << ' ' << text.to_s unless text.blank? html end |