Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #1943
Closed
Open
Issue created Mar 15, 2021 by Administrator@rootContributor

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
Assignee
Assign to
Time tracking