Module: Railsstrap::GlyphHelper
- Defined in:
- app/helpers/railsstrap/glyph_helper.rb
Instance Method Summary collapse
-
#glyph(*names) ⇒ Object
Examples glyph(:share_alt) # => <span class=“icon-share-alt”></span> glyph(:lock, :white) # => <span class=“icon-lock icon-white”></span> glyph(:thumbs_up, :pull_left) # => <i class=“icon-thumbs-up pull-left”></i> glyph(:lock, :span) # => <span class=“icon-lock”></span>.
Instance Method Details
#glyph(*names) ⇒ Object
Examples
glyph(:share_alt) # => <span class=“icon-share-alt”></span> glyph(:lock, :white) # => <span class=“icon-lock icon-white”></span> glyph(:thumbs_up, :pull_left) # => <i class=“icon-thumbs-up pull-left”></i> glyph(:lock, :span) # => <span class=“icon-lock”></span>
12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/railsstrap/glyph_helper.rb', line 12 def glyph(*names) = (names.last.kind_of?(Hash)) ? names.pop : {} names.map! { |name| name.to_s.gsub('_','-') } names.map! do |name| name =~ /pull-(?:left|right)/ ? name : "glyphicon glyphicon-#{name}" end [:tag] = [:tag] ||= :i content_tag [:tag], nil, :class => names end |