Customizing select dropdowns helps keep the UI friendly without having to store lengthy values in a database column.
After looking through the customizing_dashboard
docs I did not find a reference on how to do this. These resources helped me figure out how the select field's _form
view handled option labels:
- https://github.com/thoughtbot/administrate/blob/main/app/views/fields/select/_form.html.erb
- https://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/options_from_collection_for_select
These are before/after screenshots of this PR:
Documenting support for this would imply supporting [[value, label]]
as an input for :collection
in Field::Select.with_options
. If this is a concern I can write some tests to ensure this is accounted for in future releases.