Module: ModalHelper
- Includes:
- ActionView::Helpers, FormatHelper
- Defined in:
- app/helpers/modal_helper.rb
Instance Method Summary
collapse
#parse_content_or_options, #prepend_class, #squeeze_n_strip
Instance Method Details
#modal(options = {}, &block) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/helpers/modal_helper.rb', line 5
def modal(options={}, &block)
caption,
button_options,
modal_dialog_options,
modal_content_options = parse_modal_options(options)
((button caption, button_options) +
(content_tag :div, options do
content_tag :div, modal_dialog_options do
content_tag :div, modal_content_options, &block
end
end)).html_safe
end
|
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/helpers/modal_helper.rb', line 19
def (content_or_options=nil, options={}, &block)
content, options = parse_content_or_options(content_or_options, options)
title_options = options.delete(:title_html) || {}
prepend_class(options, 'modal-header')
= block_given? ? block : proc { modal_title(content, title_options) }
content_tag :div, options do
render_close_btn + capture(&)
end
end
|