Sha256: d73f5c571b013fd9b54b16e514e13564901a3d61f7ede79c8abe29eb4c7103cd

Contents?: true

Size: 917 Bytes

Versions: 43

Compression:

Stored size: 917 Bytes

Contents

module Kadmin
  class FormBuilder < ActionView::Helpers::FormBuilder
    # Creates a checkbox where the value is 0 when checked, 1 when unchecked.
    # @return [ActiveSupport::SafeBuffer] see Kadmin::Forms::InvertedCheckBoxTag
    def inverted_check_box(method, options = {})
      Kadmin::FormTags::InvertedCheckBox.new(@object_name, method, @template, '0', '1', objectify_options(options)).render
    end

    # Creates a Select2 enabled tag, along with the necessary Javascript
    # NOTE: Meant to be used with a Finder object in the controller
    # @return [ActiveSupport::SafeBuffer]
    def select2(method, choices, options = {}, html_options = {}, &block)
      options, html_options = Kadmin::Select2.prepare_form_tag_options(options.dup, html_options.dup)
      return ActionView::Helpers::Tags::Select.new(@object_name, method, @template, choices, options, html_options, &block).render
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
kadmin-1.3.0 app/components/kadmin/form_builder.rb
kadmin-1.2.1 app/components/kadmin/form_builder.rb
kadmin-1.2.0 app/components/kadmin/form_builder.rb
kadmin-1.1.1 app/components/kadmin/form_builder.rb
kadmin-1.1.0 app/components/kadmin/form_builder.rb
kadmin-1.0.9 app/components/kadmin/form_builder.rb
kadmin-1.0.8 app/components/kadmin/form_builder.rb
kadmin-1.0.7 app/components/kadmin/form_builder.rb
kadmin-1.0.6 app/components/kadmin/form_builder.rb
kadmin-1.0.5 app/components/kadmin/form_builder.rb
kadmin-1.0.4 app/components/kadmin/form_builder.rb
kadmin-1.0.3 app/components/kadmin/form_builder.rb
kadmin-1.0.2 app/components/kadmin/form_builder.rb
kadmin-1.0.1 app/components/kadmin/form_builder.rb
kadmin-1.0.0 app/components/kadmin/form_builder.rb
kadmin-0.9.5 app/components/kadmin/form_builder.rb
kadmin-0.9.4 app/components/kadmin/form_builder.rb
kadmin-0.8.0 app/components/kadmin/form_builder.rb
kadmin-0.7.5 app/components/kadmin/form_builder.rb
kadmin-0.7.4 app/components/kadmin/form_builder.rb