Module: RailsBootstrapWidgets::ModalHelper
- Defined in:
- app/helpers/rails-bootstrap-widgets/modal_helper.rb
Instance Method Summary collapse
Instance Method Details
#modal_form_widget(options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/rails-bootstrap-widgets/modal_helper.rb', line 5 def ( = {}, &block) if ( = _prepare(, :form)) && (content = block_given? ? capture(&block) : nil) form_tag([:action], method: :post, id: "modal", class: "modal fade", remote: true) do (_hidden([:method]) << _header([:title]) << _body(content) << (:submit, [:button], [:cancel])).html_safe end else '' end end |
#modal_view_widget(options = {}, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/rails-bootstrap-widgets/modal_helper.rb', line 15 def ( = {}, &block) content = block_given? ? capture(&block) : nil if ( = _prepare(, :view)) && content content_tag(:div, id: "modal", class: "modal fade") do (_header([:title]) << _body(content) << (:button, [:button], [:cancel], [:href], [:redirect])).html_safe end else '' end end |