Module: UrijiIcons::Rails::IconHelper
- Defined in:
- app/helpers/uriji_icons/rails/icon_helper.rb
Defined Under Namespace
Modules: Private
Constant Summary collapse
- COLOR_ICONS =
{ 'bell': 10, 'comments-dots': 8, 'credit-card': 6, 'rocket': 9 }.freeze
Instance Method Summary collapse
Instance Method Details
#uj_color_icon(key, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/uriji_icons/rails/icon_helper.rb', line 22 def uj_color_icon(key, = {}) icon_name = "uj-#{key}-color" = .merge(class: "#{icon_name} #{[:class]}") content_tag(:i, ) do paths = COLOR_ICONS[key.to_sym] paths.times.reduce(ActiveSupport::SafeBuffer.new) do |, i| + content_tag(:span, nil, class: "path#{i + 1}") end end end |
#uj_icon(names = 'flag', original_options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/uriji_icons/rails/icon_helper.rb', line 11 def uj_icon(names = 'flag', = {}) = .deep_dup classes = [] classes.concat Private.icon_names(names) classes.concat Array(.delete(:class)) text = .delete(:text) right_icon = .delete(:right) icon = content_tag(:i, nil, .merge(class: classes)) Private.icon_join(icon, text, right_icon) end |