Module: GlyphHelper

Defined in:
app/helpers/glyph_helper.rb

Instance Method Summary collapse

Instance Method Details

#glyph(*names) ⇒ Object

Examples

glyph(:share_alt) # => <i class=“icon-share-alt”></i> glyph(:lock, :white) # => <i class=“icon-lock icon-white”></i> glyph(:thumbs_up, :pull_left) # => <i class=“icon-thumbs-up pull-left”></i>



10
11
12
13
14
15
16
# File 'app/helpers/glyph_helper.rb', line 10

def glyph(*names)
  names.map! { |name| name.to_s.gsub('_','-') }
  names.map! do |name|
    name =~ /pull-(?:left|right)/ ? name : "icon-#{name}"
  end
   :i, nil, :class => names
end