Class: NfgUi::Bootstrap::Components::CardImageOverlay
- Includes:
- Components::Utilities::Titleable
- Defined in:
- lib/nfg_ui/bootstrap/components/card_image_overlay.rb
Overview
Bootstrap Card Header getbootstrap.com/docs/4.1/components/card/#header-and-footer
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Components::Utilities::Titleable
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
11 12 13 |
# File 'lib/nfg_ui/bootstrap/components/card_image_overlay.rb', line 11 def component_family :card end |
#image ⇒ Object
15 16 17 |
# File 'lib/nfg_ui/bootstrap/components/card_image_overlay.rb', line 15 def image .fetch(:image, '') end |
#render ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nfg_ui/bootstrap/components/card_image_overlay.rb', line 19 def render capture do if image concat(NfgUi::Bootstrap::Components::CardImage.new({ image: image }, view_context).render) end concat(content_tag(:div, ) { capture do concat(content_tag(:h5, title, class: 'card-title')) if title concat(block_given? ? yield : body) end }) end end |