Skip to content

Field Select - Default selected option not working #2594

@shivamvinsol

Description

@shivamvinsol

Hi, I am using Field::Select and need to show a option as selected by default.
I read the guides and it mentioned that the collection param has the same format as Rails options_for_select

options_for_select does allow selecting a option and I tried the following

collection: [['Apple', 'Ball', 'Cat'], 'Ball']
collection: [{ Apple: 1,  Ball: 2 }, 2]
collection: ['Apple', 'Ball'], selected: 'Ball'

But none of these worked.
Is there a way to do this, or do I need to add a custom field for this?

Thanks and apologies if this issue was raised earlier.

Rails - 7.1.3
Administrate - 0.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbreakages in functionality that is implemented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions