Class: Kadmin::FormBuilder

Inherits:
ActionView::Helpers::FormBuilder
  • Object
show all
Defined in:
app/components/kadmin/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#inverted_check_box(method, options = {}) ⇒ ActiveSupport::SafeBuffer

Creates a checkbox where the value is 0 when checked, 1 when unchecked.

Returns:

  • (ActiveSupport::SafeBuffer)

    see Kadmin::Forms::InvertedCheckBoxTag



5
6
7
# File 'app/components/kadmin/form_builder.rb', line 5

def inverted_check_box(method, options = {})
  Kadmin::FormTags::InvertedCheckBox.new(@object_name, method, @template, '0', '1', objectify_options(options)).render
end

#select2(method, choices, options = {}, html_options = {}, &block) ⇒ ActiveSupport::SafeBuffer

Creates a Select2 enabled tag, along with the necessary Javascript NOTE: Meant to be used with a Finder object in the controller

Returns:

  • (ActiveSupport::SafeBuffer)

    see Kadmin::Select2::FormTag



12
13
14
# File 'app/components/kadmin/form_builder.rb', line 12

def select2(method, choices, options = {}, html_options = {}, &block)
  Kadmin::Select2::FormTag.new(@object_name, method, @template, choices, options, html_options, &block).render
end