Sha256: 71046c86ce5b36e27d9ccd9be442af1f14f613ecb8777941d1051978a5915b1a

Contents?: true

Size: 502 Bytes

Versions: 4

Compression:

Stored size: 502 Bytes

Contents

module FlagIconSass
  module Rails
    module ViewHelpers
      def flag_icon(cca2, squared = false, html_options = {})
        squared, html_options = false, squared if squared.is_a?(Hash)

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

        content_tag(:span, nil, html_options)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
flag-icon-sass-1.1.3 lib/flag-icon-sass/rails/helpers.rb
flag-icon-sass-1.1.1 lib/flag-icon-sass/rails/helpers.rb
flag-icon-sass-1.1.0 lib/flag-icon-sass/rails/helpers.rb
flag-icon-sass-0.1 lib/flag-icon-sass/rails/helpers.rb