Class: Bootstrap::ViewHelpers::Components::Modal::Header

Inherits:
Bootstrap::ViewHelpers::Component show all
Defined in:
lib/bootstrap/view_helpers/components/modal/header.rb

Instance Attribute Summary

Attributes inherited from Bootstrap::ViewHelpers::Component

#block, #options, #style, #view

Instance Method Summary collapse

Methods inherited from Bootstrap::ViewHelpers::Component

#initialize

Constructor Details

This class inherits a constructor from Bootstrap::ViewHelpers::Component

Instance Method Details

#close_buttonObject



21
22
23
# File 'lib/bootstrap/view_helpers/components/modal/header.rb', line 21

def close_button
  Button::Close.new(view, {}).to_html
end

#title(title = nil) ⇒ Object



14
15
16
17
18
19
# File 'lib/bootstrap/view_helpers/components/modal/header.rb', line 14

def title(title = nil)
  title ||= title_text
  return title unless title_options[:tag]
  (title_options[:tag], title,
              class: title_options[:class])
end

#to_htmlObject



6
7
8
9
10
11
12
# File 'lib/bootstrap/view_helpers/components/modal/header.rb', line 6

def to_html
  (:div, class: 'modal-header') do
    concat(block.call(self)) if block.present?
    concat title if block.blank?
    concat close_button if dismiss
  end
end