Enum value is not searchable
Created by: khrisnagunanasurya-iav
- What were you trying to do?
I have a model that has a CEFR level
{a1: 0, a2: 1, b1: 2, b2: 3, c1: 4, c2: 5}
, and I want to make it to be searchable from the dashboard.
Here is my model dashboard
class ClassroomDashboard < Administrate::BaseDashboard
ATTRIBUTE_TYPES = {
...
level: Field::Select.with_options(searchable: true, collection: ->(field) { field.resource.class.send(field.attribute.to_s.pluralize).keys }),
...
}
...
- What did you end up with (logs, or, even better, example apps are great!)? On the search bar, I tried using these
- level:a1
- level:0
- a1
but none of them are working, is this a bug or feature?
- What versions are you running?
- Rails 6.1.1
- administrate 0.15.0