Class: SimpleForm::HorizontalFormBuilder
Constant Summary
collapse
- CHECKBOX_WRAPPER =
:horizontal_checkbox
- RADIO_WRAPPER =
:horizontal_radio
Instance Method Summary
collapse
-
#buttons(options = {}, &block) ⇒ Object
-
#collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
-
#collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
#checkbox, #input, #radio
Instance Method Details
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.content_tag(:div, class: 'form-group') do
@template.content_tag(:div, class: options[:class]) do
yield
end
end
end
|
#collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) ⇒ Object
16
17
18
19
|
# File 'lib/simple_form/horizontal_form_builder.rb', line 16
def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
options[:item_wrapper_class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10 checkbox'
super
end
|
21
22
23
24
|
# File 'lib/simple_form/horizontal_form_builder.rb', line 21
def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
options[:item_wrapper_class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10 radio'
super
end
|