administrate
administrate copied to clipboard
Field Select - Default selected option not working
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
I've made a PR for this issue:
https://github.com/thoughtbot/administrate/pull/2676