Sha256: bb572573df3fef3d4d4ccbeb7bc22cf4fe386793700bd2c18277d6a590749068

Contents?: true

Size: 516 Bytes

Versions: 5

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

module Utilities::IconHelper

  ##
  # Genera le icone di Bootstrap icons
  def icon( name, text = nil, html_options = {})
    text, html_options = nil, text if text.is_a?(Hash)

    content_class = "bi-#{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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
base_editing_bootstrap-1.0.0 app/helpers/utilities/icon_helper.rb
base_editing_bootstrap-0.16.1 app/helpers/utilities/icon_helper.rb
base_editing_bootstrap-0.16.0 app/helpers/utilities/icon_helper.rb
base_editing_bootstrap-0.15.0 app/helpers/utilities/icon_helper.rb
base_editing_bootstrap-0.14.0 app/helpers/utilities/icon_helper.rb