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 = {}, &block) ⇒ Object



4
5
6
7
# File 'lib/bootstrap_form/inputs/submit.rb', line 4

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

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



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

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



9
10
11
12
# File 'lib/bootstrap_form/inputs/submit.rb', line 9

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