Skip to content

Instantly share code, notes, and snippets.

@kuboon
Created July 26, 2012 08:15
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kuboon/3180918 to your computer and use it in GitHub Desktop.
glyph icon helper for twitter-bootstrap with Rails
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
@Rongorongo
Copy link

Thanks, this helped me a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment