Class: Bulmacomp::ModalComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Bulmacomp::ModalComponent
- Defined in:
- app/components/bulmacomp/modal_component.rb
Overview
Make an html structure for a bulma breadcrumb
Instance Method Summary collapse
-
#call ⇒ Object
return [String] html_safe generated bulma modal.
-
#initialize(**opts) {|optional| ... } ⇒ ModalComponent
constructor
A new instance of ModalComponent.
Constructor Details
#initialize(**opts) {|optional| ... } ⇒ ModalComponent
Returns a new instance of ModalComponent.
28 29 30 31 |
# File 'app/components/bulmacomp/modal_component.rb', line 28 def initialize(**opts) super @opts = { class: 'modal' }.merge opts end |
Instance Method Details
#call ⇒ Object
return [String] html_safe generated bulma modal
34 35 36 37 38 39 40 |
# File 'app/components/bulmacomp/modal_component.rb', line 34 def call content_tag :div, safe_join([ tag.div(class: 'modal-background'), tag.div(content, class: 'modal-content'), tag.(class: 'modal-close is-large', aria_label: 'close') ]), **@opts end |