23 lines
552 B
Ruby
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
|