Module: FontawesomeSubsetter::IconHelper
- Defined in:
- lib/fontawesome_subsetter/icon_helper.rb
Instance Method Summary collapse
Instance Method Details
#icon(style, name, text = nil, html_options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fontawesome_subsetter/icon_helper.rb', line 5 def icon(style, name, text = nil, = {}, &block) text, = nil, text if text.is_a?(Hash) [:class] = "#{ style } fa-#{ name.to_s.dasherize }#{ " #{ [:class] }" if .key? :class }" html = content_tag :i, nil, html = "#{ html } #{ text }" if text.present? html = "#{ html } #{ capture block }" if block_given? html.html_safe end |