Module: IconHelper
- Defined in:
- app/helpers/icon_helper.rb
Instance Method Summary collapse
-
#icon(name, lbl = nil, options = {}) ⇒ Object
I wanted to make a named param out of label, though this would imply a backwards incompatible change that would require a non-trivial amount of editing.
- #spinner_icon ⇒ Object
Instance Method Details
#icon(name, lbl = nil, options = {}) ⇒ Object
I wanted to make a named param out of label, though this would imply a backwards incompatible change that would require a non-trivial amount of editing.
If you want to take this along with the next planned major release, you can use the following CMD in bash (assuming you have silver searcher installed) to get a list of all icon calls that pass anything more than just a name.
ag 'icon\((:|")(\w+), '
12 13 14 15 16 17 18 19 |
# File 'app/helpers/icon_helper.rb', line 12 def icon(name, lbl = nil, = {}) classes = "fa fa-#{name.to_s.tr('_', '-')}" classes = classes.concat(" #{[:class].to_s}") if [:class] [:class] = classes markup = content_tag :i, nil, lbl ? "#{markup} #{lbl}".html_safe : markup end |
#spinner_icon ⇒ Object
21 22 23 |
# File 'app/helpers/icon_helper.rb', line 21 def spinner_icon icon :spinner, '', class: 'fa-spin' end |