Module: Bootstrap::ViewHelpers::ModalHelper

Defined in:
app/helpers/bootstrap/view_helpers/modal_helper.rb

Instance Method Summary collapse

Instance Method Details

#bs_card_header(title_or_options = nil, options = {}, &block) ⇒ Object



12
13
14
15
16
17
# File 'app/helpers/bootstrap/view_helpers/modal_helper.rb', line 12

def bs_card_header(title_or_options = nil, options = {}, &block)
  options = title_or_options if block && title_or_options.is_a?(Hash)
  options[:title] = title_or_options if title_or_options.is_a?(String)

  Components::Card.new(self, options || {}, &block).header
end

#bs_modal(title_or_options = nil, opts = {}, &block) ⇒ Object



4
5
6
7
8
9
10
# File 'app/helpers/bootstrap/view_helpers/modal_helper.rb', line 4

def bs_modal(title_or_options = nil, opts = {}, &block)
  options = title_or_options if block && title_or_options.is_a?(Hash)
  options ||= opts || {}
  options[:title] = title_or_options if title_or_options.is_a?(String)

  Components::Modal.new(self, options || {}, &block).to_html
end