Module: Utilities::IconHelper
- Included in:
- BaseEditingHelper, FormHelper, PageHelper, SearchHelper
- Defined in:
- app/helpers/utilities/icon_helper.rb
Instance Method Summary collapse
-
#icon(name, text = nil, html_options = {}) ⇒ Object
Genera le icone di Bootstrap icons.
Instance Method Details
#icon(name, text = nil, html_options = {}) ⇒ Object
Genera le icone di Bootstrap icons
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/utilities/icon_helper.rb', line 7 def icon( name, text = nil, = {}) text, = nil, text if text.is_a?(Hash) content_class = "bi-#{name}" content_class += " #{html_options[:class]}" if .key?(:class) [:class] = content_class ['aria-hidden'] ||= true html = content_tag(:i, nil, ) html << ' ' << text.to_s unless text.blank? html end |