class EndView::Bootstrap::FormModal

Public Class Methods

render(*args, &b) click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 12
def self.render(*args, &b)
  new(*args).render(&b)
end

Public Instance Methods

render(*args, &b) click to toggle source
Calls superclass method
# File lib/end_view/bootstrap/form_modal.rb, line 18
def render(*args, &b)
  super(*args) { Modal.render(id, opts_with_buttons, &b) }
end

Private Instance Methods

buttons() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 38
def buttons
  [[cancel_opts, cancel_value], [submit_opts, submit_value]]
end
cancel_opts() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 42
def cancel_opts
  { class: 'btn btn-default', 'data-dismiss' => :modal }
end
cancel_value() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 30
def cancel_value
  opts[:cancel_value] || 'Cancel'
end
opts_with_buttons() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 26
def opts_with_buttons
  { buttons: buttons }.merge(@opts)
end
submit_opts() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 46
def submit_opts
  { class: 'btn btn-primary', type: 'submit' }
end
submit_value() click to toggle source
# File lib/end_view/bootstrap/form_modal.rb, line 34
def submit_value
  opts[:submit_value] || 'Okay'
end