Sha256: 5bff3070326192893f8e66ac3a425a366a310361338ddff5adefee0b29913417

Contents?: true

Size: 525 Bytes

Versions: 12

Compression:

Stored size: 525 Bytes

Contents

module FontAwesome
  module Sass
    module Rails
      module ViewHelpers
        def icon(icon, text = nil, html_options = {})
          text, html_options = nil, text if text.is_a?(Hash)

          content_class = "fa fa-#{icon}"
          content_class << " #{html_options[:class]}" if html_options.key?(:class)
          html_options[:class] = content_class

          html = content_tag(:i, nil, html_options)
          html << ' ' << text.to_s unless text.blank?
          html
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
nex-font-awesome-sass-4.7.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-c-4.7.2 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sassc-4.7.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-c-4.7.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sassc-4.7.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.7.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.6.2 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.6.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.5.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.4.0 lib/font_awesome/sass/rails/helpers.rb
semantic-fa-sass-1.0.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-4.3.2.1 lib/font_awesome/sass/rails/helpers.rb