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
- #menu_remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top') ⇒ Object
-
#remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top') ⇒ Object
Render a material icon tag.
Instance Method Details
#menu_remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top') ⇒ Object
7 8 9 10 |
# File 'app/helpers/core_remix_icon_helper.rb', line 7 def (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}" = { class: classes } if tooltip_text.present? ['data-bs-toggle'] = 'tooltip' ['data-bs-placement'] = tooltip_placement ['data-bs-title'] = tooltip_text end content_tag(:i, ) {} end |