cs_app/app/helpers/icon_helper.rb
Nicolas Bally 8a08ee35c8 initial
2015-02-22 14:36:30 +01:00

23 lines
552 B
Ruby

# -*- encoding : utf-8 -*-
module IconHelper
def i(icon, html_options={}, text="")
ic(icon, html_options, text, true)
end
def ic(icon, html_options={}, text="", round=false)
html_options = {} if html_options == nil
content_class = "fa fa-#{icon} "
content_class += "icon " if round
content_class << " #{html_options[:class]}" if html_options.key?(:class)
html_options[:class] = content_class
html = content_tag(:i, nil, html_options)
html << " #{text}" unless text.blank?
html.html_safe
end
end