Module: BootstrapForm::Inputs::Submit

Included in:
FormBuilder
Defined in:
lib/bootstrap_form/inputs/submit.rb

Instance Method Summary collapse

Instance Method Details

#button(value = nil, options = {}) ⇒ Object



6
7
8
9
# File 'lib/bootstrap_form/inputs/submit.rb', line 6

def button(value=nil, options={}, &)
  value = setup_css_class "btn btn-secondary", value, options
  super
end

#primary(value = nil, options = {}, &block) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/bootstrap_form/inputs/submit.rb', line 16

def primary(value=nil, options={}, &block)
  value = setup_css_class "btn btn-primary", value, options

  if options[:render_as_button] || block
    options.except! :render_as_button
    button(value, options, &block)
  else
    submit(value, options)
  end
end

#submit(value = nil, options = {}) ⇒ Object



11
12
13
14
# File 'lib/bootstrap_form/inputs/submit.rb', line 11

def submit(value=nil, options={})
  value = setup_css_class "btn btn-secondary", value, options
  layout == :inline ? form_group { super } : super
end