Class: Bootstrap4RailsComponents::Bootstrap::Components::CardImageOverlay
- Inherits:
-
Base
- Object
- Base
- Bootstrap4RailsComponents::Bootstrap::Components::CardImageOverlay
- Includes:
- Utilities::Titleable
- Defined in:
- lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb
Overview
Bootstrap Card Header getbootstrap.com/docs/4.1/components/card/#header-and-footer
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Utilities::Titleable
Methods inherited from Base
#component_initialize, #data, #href, #html_options, #id, #initialize, #style, #utility_initialize
Constructor Details
This class inherits a constructor from Bootstrap4RailsComponents::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
11 12 13 |
# File 'lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb', line 11 def component_family :card end |
#image ⇒ Object
15 16 17 |
# File 'lib/bootstrap4_rails_components/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/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb', line 19 def render capture do if image concat(Bootstrap4RailsComponents::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 |