class Bootstrap4RailsComponents::Bootstrap::Components::CardImageOverlay

Bootstrap Card Header getbootstrap.com/docs/4.1/components/card/#header-and-footer

Public Instance Methods

component_family() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb, line 11
def component_family
  :card
end
image() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb, line 15
def image
  options.fetch(:image, '')
end
render() { |: body)| ... } click to toggle source
# 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, html_options) {
      capture do
        concat(content_tag(:h5, title, class: 'card-title')) if title
        concat(block_given? ? yield : body)
      end
    })
  end
end

Private Instance Methods

component_css_class() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb, line 36
def component_css_class
  'card-img-overlay'
end
non_html_attribute_options() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/card_image_overlay.rb, line 40
def non_html_attribute_options
  super.push(:image)
end