Module: Bh::GlyphiconHelper

Includes:
BaseHelper
Included in:
Form::BaseHelper
Defined in:
lib/bh/helpers/glyphicon_helper.rb

Overview

Provides methods to include Glyphicons.

Instance Method Summary collapse

Instance Method Details

#glyphicon(name = nil, options = {}) ⇒ String

Returns an HTML block tag that follows the Bootstrap documentation on how to display glyphicons.

Examples:

Display the “zoom in” glyphicon

glyphicon :zoom_in

Display the “zoom out” glyphicon

glyphicon 'zoom-out'

Parameters:

  • the (#to_s)

    name of the icon to display, with either dashes or underscores to separate multiple words.

Returns:

  • (String)

    an HTML block tag for a glyphicon.



18
19
20
21
22
# File 'lib/bh/helpers/glyphicon_helper.rb', line 18

def glyphicon(name = nil, options = {})
  append_class! options, 'glyphicon'
  append_class! options, "glyphicon-#{name.to_s.gsub '_', '-'}" if name
   :span, nil, options
end