Class: Kadmin::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Kadmin::FormBuilder
- Defined in:
- app/components/kadmin/form_builder.rb
Instance Method Summary collapse
-
#inverted_check_box(method, options = {}) ⇒ ActiveSupport::SafeBuffer
Creates a checkbox where the value is 0 when checked, 1 when unchecked.
-
#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.
Instance Method Details
#inverted_check_box(method, options = {}) ⇒ ActiveSupport::SafeBuffer
Creates a checkbox where the value is 0 when checked, 1 when unchecked.
5 6 7 |
# File 'app/components/kadmin/form_builder.rb', line 5 def inverted_check_box(method, = {}) Kadmin::FormTags::InvertedCheckBox.new(@object_name, method, @template, '0', '1', ()).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
12 13 14 15 |
# File 'app/components/kadmin/form_builder.rb', line 12 def select2(method, choices, = {}, = {}, &block) , = Kadmin::Select2.(.dup, .dup) return ActionView::Helpers::Tags::Select.new(@object_name, method, @template, choices, , , &block).render end |