Module: CoreRemixIconHelper

Defined in:
app/helpers/core_remix_icon_helper.rb

Overview

Draw remix icons on the page, includes tooltip mark up

Instance Method Summary collapse

Instance Method Details



7
8
9
10
# File 'app/helpers/core_remix_icon_helper.rb', line 7

def menu_remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top')
  classes += %w[menu-icon tf-icons]
  remix_icon(icon_name, classes: classes, type: type, tooltip_text: tooltip_text, tooltip_placement: tooltip_placement)
end

#remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top') ⇒ Object

Render a material icon tag



13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/core_remix_icon_helper.rb', line 13

def remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top')
  classes << "ri-#{icon_name}-#{type}"
  options = { class: classes }
  if tooltip_text.present?
    options['data-bs-toggle'] = 'tooltip'
    options['data-bs-placement'] = tooltip_placement
    options['data-bs-title'] = tooltip_text
  end
  (:i, options) {}
end