Module: GlyphiconHelper
- Defined in:
- app/helpers/glyphicon_helper.rb
Instance Method Summary collapse
-
#glyph(name, options = {}) ⇒ Object
Return the Twitter Bootstrap glyphicon html markup Parameter name is the name of icon Parameter options is the hash of additional options generating span.
Instance Method Details
#glyph(name, options = {}) ⇒ Object
Return the Twitter Bootstrap glyphicon html markup Parameter name is the name of icon Parameter options is the hash of additional options generating span
invoke glyph :search
returns <span class=“glyphicon glyphicon-search”></span>
invoke glyph :search, class: ‘pull-right’
returns <span class=“pull-right glyphicon glyphicon-search”></span>
invoke glyph :search, class: ‘pull-right’, data: { action: ‘search’ }
returns <span class=“pull-right glyphicon glyphicon-search” data-action=“search”></span>
28 29 30 31 32 33 34 35 36 37 |
# File 'app/helpers/glyphicon_helper.rb', line 28 def glyph(name, ={}) = .dup glyph_classes = parse_html_classes_to_arr [:class] glyph_classes << 'glyphicon' glyph_classes << "glyphicon-#{name.to_s.gsub('_', '-')}" [:class] = glyph_classes content_tag :span, '', end |