Module: Optimacms::FormsHelper

Defined in:
app/helpers/optimacms/forms_helper.rb

Instance Method Summary collapse

Instance Method Details

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



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/optimacms/forms_helper.rb', line 3

def horizontal_simple_form_for(resource, options = {}, &block)
  options[:html] ||= {}

  # class
  options[:html][:class] ||= []
  if options[:html][:class].is_a? Array
    options[:html][:class] << 'form-horizontal'
  else
    options[:html][:class] << ' form-horizontal'
  end
  options[:html][:role] = 'form'


  options[:wrapper] = :horizontal_form
  options[:wrapper_mappings] = {
    check_boxes: :horizontal_radio_and_checkboxes,
    radio_buttons: :horizontal_radio_and_checkboxes,
    file: :horizontal_file_input,
    boolean: :horizontal_boolean
  }
  simple_form_for(resource, options, &block)
end