Class: SimpleForm::HorizontalFormBuilder

Inherits:
DefaultFormBuilder show all
Defined in:
lib/simple_form/horizontal_form_builder.rb

Constant Summary collapse

CHECKBOX_WRAPPER =
:horizontal_checkbox
RADIO_WRAPPER =
:horizontal_radio

Instance Method Summary collapse

Methods inherited from DefaultFormBuilder

#checkbox, #input, #radio

Instance Method Details

#buttons(options = {}, &block) ⇒ Object

Raises:

  • (::ArgumentError)


6
7
8
9
10
11
12
13
14
# File 'lib/simple_form/horizontal_form_builder.rb', line 6

def buttons(options = {}, &block)
  raise ::ArgumentError unless block_given?
  options[:class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10'
  @template.(:div, class: 'form-group') do
    @template.(:div, class: options[:class]) do
      yield
    end
  end
end