zeus.ugent.be/lib/helpers/font_awesome.rb
2017-10-11 00:33:37 +02:00

14 lines
410 B
Ruby

module FontAwesomeHelper
def fa(icon, opts = {})
classes = ['fa', "fa-#{icon}"]
classes << "fa-#{opts[:size]}" if opts[:size]
classes << 'fa-li' if opts[:li]
classes << "fa-stack-#{opts[:stack]}" if opts[:stack]
classes << 'fa-inverse' if opts[:inverse]
classes << 'fa-fw' if opts[:fw]
classes << opts[:class]
"<i class='#{classes.reject(&:nil?).join(' ')}'></i>"
end
end