Module: RailsBootstrapWidgets::ModalHelper

Defined in:
app/helpers/rails-bootstrap-widgets/modal_helper.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
11
12
13
# File 'app/helpers/rails-bootstrap-widgets/modal_helper.rb', line 5

def modal_form_widget(options = {}, &block)
if (options = _prepare(options, :form)) && (content = block_given? ? capture(&block) : nil)
   form_tag(options[:action], method: :post, id: "modal", class: "modal fade", remote: true) do
     (_hidden(options[:method]) << _header(options[:title]) << _body(content) << _footer(:submit, options[:button], options[:cancel])).html_safe
   end
 else
 	''
	end
end


15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/rails-bootstrap-widgets/modal_helper.rb', line 15

def modal_view_widget(options = {}, &block)
	content = block_given? ? capture(&block) : nil
	if (options = _prepare(options, :view)) && content
		(:div, id: "modal", class: "modal fade") do
			(_header(options[:title]) << _body(content) << _footer(:button, options[:button], options[:cancel], options[:href], options[:redirect])).html_safe
		end
	else
		''
	end
end