Module: Booties::PopoverHelper
- Includes:
- Utils
- Defined in:
- app/helpers/booties/popover_helper.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#popover(text = nil, tag: :a, container: nil, content:, title: nil, placement: nil, trigger: nil, **options, &block) ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/ParameterLists.
Methods included from Utils
Instance Method Details
#popover(text = nil, tag: :a, container: nil, content:, title: nil, placement: nil, trigger: nil, **options, &block) ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/helpers/booties/popover_helper.rb', line 46 def popover(text = nil, tag: :a, container: nil, content:, title: nil, placement: nil, trigger: nil, **, &block) data = { toggle: 'popover', content: content, container: container, placement: placement, trigger: trigger, } [tag == :button ? :type : :role] ||= 'button' [:title] = title [:tabindex] ||= 10 if trigger [:data] ||= {} [:data].update data content_tag tag, text, , &block end |