Low commit activity in last 3 years
A long-lived project that still receives updates
Custom Administrate field collection_select
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.4

Runtime

>= 0.7, < 1.0
> 5.0, < 7.1
 Project Readme

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',
  ),
]