Class: Trek::FormBuilder

Inherits:
ViewComponent::Form::Builder
  • Object
show all
Defined in:
app/forms/trek/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#content_editor(method, options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'app/forms/trek/form_builder.rb', line 34

def content_editor(method, options = {}, &)
  render_component(
    :content_editor,
    @object_name,
    method,
    objectify_options(options),
    &
  )
end

#group(method, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/forms/trek/form_builder.rb', line 6

def group(method, options = {}, &)
  render_component(
    :group,
    @object_name,
    method,
    objectify_options(options),
    &
  )
end

#image_field(method, options = {}) ⇒ Object



16
17
18
19
20
21
22
23
# File 'app/forms/trek/form_builder.rb', line 16

def image_field(method, options = {})
  render_component(
    :image_field,
    @object_name,
    method,
    objectify_options(options)
  )
end

rubocop:disable Metrics/ParameterLists



51
52
53
54
55
56
# File 'app/forms/trek/form_builder.rb', line 51

def link_select(method, collection, value_method, text_method, options = {}, html_options = {})
  render_component(
    :link_select, @object_name, method, collection, value_method, text_method,
    objectify_options(options), @default_html_options.merge(html_options)
  )
end

#sound_field(method, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
# File 'app/forms/trek/form_builder.rb', line 25

def sound_field(method, options = {})
  render_component(
    :sound_field,
    @object_name,
    method,
    objectify_options(options)
  )
end

#switch_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object



44
45
46
47
48
# File 'app/forms/trek/form_builder.rb', line 44

def switch_box(method, options = {}, checked_value = "1", unchecked_value = "0")
  render_component(
    :switch_box, @object_name, method, checked_value, unchecked_value, objectify_options(options)
  )
end