Created
July 26, 2012 08:15
-
-
Save kuboon/3180918 to your computer and use it in GitHub Desktop.
glyph icon helper for twitter-bootstrap with Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
# ==== Examples | |
# glyph(:share_alt) | |
# # => <i class="icon-share-alt"></i> | |
# glyph(:lock, :white) | |
# # => <i class="icon-lock icon-white"></i> | |
def glyph(*names) | |
content_tag :i, nil, class: names.map{|name| "icon-#{name.to_s.gsub('_','-')}" } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works wonderfully!