Sha256: 57b939cb7aa2f69d369be45fc1a07f13cbc19ae5bb3571616908c8f09fa855f0

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

module Trestle
  class Form
    module Fields
      class TagSelect < Select
        def initialize(builder, template, name, options={}, html_options={})
          choices = builder.object.send(name)
          super(builder, template, name, choices, options, html_options)
        end

        def default_html_options
          super.merge(multiple: true, class: "tag-select", data: { tags: true, select_on_close: true })
        end
      end
    end
  end
end

Trestle::Form::Builder.register(:tag_select, Trestle::Form::Fields::TagSelect)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trestle-0.8.3 lib/trestle/form/fields/tag_select.rb
trestle-0.8.2 lib/trestle/form/fields/tag_select.rb
trestle-0.8.0 lib/trestle/form/fields/tag_select.rb