Module: Decidim::TooltipHelper

Included in:
CardLCell, FormBuilder, LayoutHelper
Defined in:
decidim-core/lib/decidim/tooltip_helper.rb

Overview

This helper includes some methods to help with the inclusion of tooltips on the layout.

Instance Method Summary collapse

Instance Method Details

#with_tooltip(title, opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'decidim-core/lib/decidim/tooltip_helper.rb', line 7

def with_tooltip(title, opts = {}, &)
  (:span,
              title:,
              class: "inline-block",
              data: { controller: :tooltip,
                      "tooltip-tooltip-value": (:p, title, id: opts[:id], class: opts[:class] || "bottom", role: "tooltip", "aria-hidden": "true") }) do
    capture(&).html_safe
  end
end