Class: Bootstrap::ViewHelpers::Components::Modal::Header
Instance Attribute Summary
#block, #options, #style, #view
Instance Method Summary
collapse
#initialize
Instance Method Details
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]
content_tag(title_options[:tag], title,
class: title_options[:class])
end
|
#to_html ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/bootstrap/view_helpers/components/modal/header.rb', line 6
def to_html
content_tag(:div, class: 'modal-header') do
concat(block.call(self)) if block.present?
concat title if block.blank?
concat close_button if dismiss
end
end
|