Module: FontAwesome::Sass::Rails::ViewHelpers
- Defined in:
- lib/font_awesome/sass/rails/helpers.rb
Instance Method Summary collapse
Instance Method Details
#icon(icon, text = nil, html_options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/font_awesome/sass/rails/helpers.rb', line 5 def icon(icon, text = nil, = {}) text, = nil, text if text.is_a?(Hash) content_class = "fa fa-#{icon}" content_class << " #{[:class]}" if .key?(:class) [:class] = content_class html = content_tag(:i, nil, ) html << ' ' << text.to_s unless text.blank? html end |