Module: Manage::BootstrapFormHelper

Defined in:
app/helpers/manage/bootstrap_form_helper.rb

Instance Method Summary collapse

Instance Method Details

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



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/manage/bootstrap_form_helper.rb', line 23

def bs_horizontal_simple_form_for(path, options = {}, &block)
  bootstrap_options = {
    wrapper: :bootstrap_horizontal_form,
    wrapper_mappings: {
      boolean:       :bootstrap_horizontal_boolean,
      check_boxes:   :bootstrap_horizontal_collection,
      date:          :bootstrap_horizontal_multi_select,
      datetime:      :bootstrap_horizontal_multi_select,
      file:          :bootstrap_horizontal_file,
      radio_buttons: :bootstrap_horizontal_collection,
      range:         :bootstrap_horizontal_range,
      time:          :bootstrap_horizontal_multi_select
    }
  }
  options = options.deep_merge(bootstrap_options)
  patch_simple_form_config do
    simple_form_for(path, options, &block)
  end
end

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



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

def bs_vertical_simple_form(path, options = {}, &block)
  bootstrap_options = {
    wrapper: :bootstrap_vertical_form,
    wrapper_mappings: {
      boolean:       :bootstrap_vertical_boolean,
      check_boxes:   :bootstrap_vertical_collection,
      date:          :bootstrap_vertical_multi_select,
      datetime:      :bootstrap_vertical_multi_select,
      file:          :bootstrap_vertical_file,
      radio_buttons: :bootstrap_vertical_collection,
      range:         :bootstrap_vertical_range,
      time:          :bootstrap_vertical_multi_select
    }
  }
  options = options.deep_merge(bootstrap_options)
  patch_simple_form_config do
    simple_form_for(path, options, &block)
  end
end