Sha256: 0bc79666e9a107eda69b7dbe77723712c3b18e1df2456485074e8c2ee8dcd944
Contents?: true
Size: 765 Bytes
Versions: 19
Compression:
Stored size: 765 Bytes
Contents
module IconHelper # I wanted to make a named param out of label, though this would imply a # backwards incompatible change that would require a non-trivial amount of # editing. # # If you want to take this along with the next planned major release, you can # use the following CMD in bash (assuming you have silver searcher installed) # to get a list of all icon calls that pass anything more than just a name. # # ag 'icon\((:|")(\w+), ' # def icon(name, lbl = nil, options = {}) classes = "fa fa-#{name.to_s.tr('_', '-')}" classes = classes.concat(" #{options[:class].to_s}") if options[:class] options[:class] = classes markup = content_tag :i, nil, options lbl ? "#{markup} #{lbl}".html_safe : markup end end
Version data entries
19 entries across 19 versions & 1 rubygems