Module: Interage::FontAwesomeHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/interage/font_awesome_helper.rb
Instance Method Summary collapse
- #fa_classes(icon, options = {}) ⇒ Object
- #fa_fw_icon(icon, options = {}) ⇒ Object
- #fa_icon(icon, options = {}) ⇒ Object
- #fa_icon_text(icon, text, options = {}) ⇒ Object
- #fa_icons ⇒ Object
Instance Method Details
#fa_classes(icon, options = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/interage/font_awesome_helper.rb', line 24 def fa_classes(icon, = {}) icon_classes = icon.to_s.split(' ').uniq.join(' fa-') "fa fa-#{icon_classes} #{[:class]}".strip end |
#fa_fw_icon(icon, options = {}) ⇒ Object
13 14 15 |
# File 'lib/interage/font_awesome_helper.rb', line 13 def fa_fw_icon(icon, = {}) fa_icon("fw #{icon}", ) end |
#fa_icon(icon, options = {}) ⇒ Object
9 10 11 |
# File 'lib/interage/font_awesome_helper.rb', line 9 def fa_icon(icon, = {}) content_tag :i, nil, .merge(class: fa_classes(icon, )) end |
#fa_icon_text(icon, text, options = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/interage/font_awesome_helper.rb', line 17 def fa_icon_text(icon, text, = {}) content_tag :span do concat fa_fw_icon(icon, ) concat text end end |
#fa_icons ⇒ Object
5 6 7 |
# File 'lib/interage/font_awesome_helper.rb', line 5 def fa_icons t('icons_alias', default: {}).keys end |