Module: Components::TooltipHelper

Defined in:
app/helpers/components/tooltip_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_tooltip(**options, &block) ⇒ Object



2
3
4
5
# File 'app/helpers/components/tooltip_helper.rb', line 2

def render_tooltip(**options, &block)
  content = capture(&block) if block
  render "components/ui/tooltip", content: content, **options
end

#tooltip_content(options = {}, &block) ⇒ Object



11
12
13
14
# File 'app/helpers/components/tooltip_helper.rb', line 11

def tooltip_content(options = {}, &block)
  content_for :tooltip_content_class, options[:class], flush: true
  content_for :tooltip_content, capture(&block), flush: true
end

#tooltip_trigger(&block) ⇒ Object



7
8
9
# File 'app/helpers/components/tooltip_helper.rb', line 7

def tooltip_trigger(&block)
  content_for :tooltip_trigger, capture(&block), flush: true
end