Skip to content

Instantly share code, notes, and snippets.

@benoitr
Forked from kuboon/application_helper.rb
Created June 30, 2013 11:12
Show Gist options
  • Save benoitr/5894788 to your computer and use it in GitHub Desktop.
Save benoitr/5894788 to your computer and use it in GitHub Desktop.
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