Sha256: db941a44d27dd3b4538ee19f6c5d71560237acd03e5dd90bcd0b08dda0c29473

Contents?: true

Size: 423 Bytes

Versions: 7

Compression:

Stored size: 423 Bytes

Contents

module AbAdmin
  module Views
    module Inputs
      class TreeSelectInput < ::SimpleForm::Inputs::CollectionSelectInput
        def input
          options[:collection] ||= begin
            collection_class = options.delete(:collection_class) || object.class
            object.nested_opts(collection_class.all)
          end
          options[:collection] ||= []
          super
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.2.3 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.2.2 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.2.1 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.2.0 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.1.2 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.1.1 lib/ab_admin/views/inputs/tree_select_input.rb
ab_admin-0.1.0 lib/ab_admin/views/inputs/tree_select_input.rb