Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 744 Bytes

File metadata and controls

39 lines (29 loc) · 744 Bytes

Administrate::Field::CollectionSelect

A plugin for Administrate

Usage

Add to your Gemfile:

gem 'administrate-field-collection_select'

Run:

$ bundle install

Add to your FooDashboard:

Supports all of the options that a normal Rails collection_select does including multiple: true

NOTE: Make sure to specify the collection query as a proc

ATTRIBUTE_TYPES = [
  bars: Field::CollectionSelect.with_options(
    collection: proc { Bar.all },
    value_method: :id,
    text_method: :name,
    options: {
      include_blank: 'Please Select A/Some Bars',
      include_hidden: false,
    },
    multiple: true,
    label: 'Good Bars',
  ),
]