Class: NfgUi::Bootstrap::Components::ModalHeader
- Defined in:
- lib/nfg_ui/bootstrap/components/modal_header.rb
Overview
Bootstrap Modal Component getbootstrap.com/docs/4.1/components/modal/
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods inherited from Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
10 11 12 |
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 10 def component_family :modal end |
#render ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 18 def render super do capture do concat(content_tag(:h5, title, class: 'modal-title')) if title concat(NfgUi::Bootstrap::Components::Button.new({ as: :button, class: 'close', theme: nil, data: { dismiss: 'modal' }, aria: { label: 'Close' } }, view_context).render { content_tag(:span, "×".html_safe, { aria: { hidden: 'true' } }) }) end end end |
#title ⇒ Object
14 15 16 |
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 14 def title .fetch(:title, nil) end |