Sha256: 98e0b6cf4773f33c59df6b9f784427fc5873e9db3aa9252f91246c3bf3af380f

Contents?: true

Size: 853 Bytes

Versions: 6

Compression:

Stored size: 853 Bytes

Contents

require 'bh/helpers/base_helper'

module Bh
  # Provides methods to include Glyphicons.
  # @see http://getbootstrap.com/components/#glyphicons
  module GlyphiconHelper
    include BaseHelper

    # Returns an HTML block tag that follows the Bootstrap documentation
    # on how to display *glyphicons*.
    # @return [String] an HTML block tag for a glyphicon.
    # @param [#to_s] the name of the icon to display, with either dashes or
    #   underscores to separate multiple words.
    # @example Display the "zoom in" glyphicon
    #   glyphicon :zoom_in
    # @example Display the "zoom out" glyphicon
    #   glyphicon 'zoom-out'
    def glyphicon(name = nil, options = {})
      append_class! options, 'glyphicon'
      append_class! options, "glyphicon-#{name.to_s.gsub '_', '-'}" if name
      content_tag :span, nil, options
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bh-1.0.1 lib/bh/helpers/glyphicon_helper.rb
bh-1.0.0 lib/bh/helpers/glyphicon_helper.rb
bh-0.0.8 lib/bh/helpers/glyphicon_helper.rb
bh-0.0.7 lib/bh/helpers/glyphicon_helper.rb
bh-0.0.6 lib/bh/helpers/glyphicon_helper.rb
bh-0.0.5 lib/bh/helpers/glyphicon_helper.rb