Sha256: 100d6c3a77c960906ba435831e0af26f06bf4f40718b678803b4c56992dc1ed3

Contents?: true

Size: 585 Bytes

Versions: 12

Compression:

Stored size: 585 Bytes

Contents

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

          content_class = "#{style} fa-#{name}"
          content_class << " #{html_options[:class]}" if html_options.key?(:class)
          html_options[:class] = content_class
          html_options['aria-hidden'] ||= true

          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 & 1 rubygems

Version Path
font-awesome-sass-6.5.2 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.5.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.5.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.4.2 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.4.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.3.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.2.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.2.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.1.2 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.1.1 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.1.0 lib/font_awesome/sass/rails/helpers.rb
font-awesome-sass-6.0.0 lib/font_awesome/sass/rails/helpers.rb