Module: Components::HoverCardHelper

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

Instance Method Summary collapse

Instance Method Details

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



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

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

#hover_card_trigger(&block) ⇒ Object



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

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

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



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

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