Module: ViewComponent::ModalBoxComponent
- Included in:
- UiHelper
- Defined in:
- app/helpers/view_component/modal_box_component.rb
Defined Under Namespace
Classes: ModalBoxComponent
Instance Method Summary collapse
Instance Method Details
#modal_box_component(title: nil, variant: nil, modal_footer: nil, html_options: {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/view_component/modal_box_component.rb', line 14 def modal_box_component(title: nil, variant: nil, modal_footer: nil, html_options: {}, &) modal = ModalBoxComponent.new(title:, variant:) block_content = capture(&) if block_given? container_class = if variant == :success 'modal-success' else 'modal-container' end render partial: 'view_components/modal_component/modal_box_component', locals: { modal:, body: block_content, modal_footer:, container_class:, html_options: } end |