Hey everyone. I'm trying to do something seemingly simple and can't figure
it out.
An article belongs to a state. When editing the article, I want the states
list to be in alphabetical order (by :name). But they are appearing by :id
desc.
I have tried
- setting a default_scope on the state model to order(:name)
- overriding the column in rails admin config (see below)
config.model Article do
list do; end
export do; end
show do; end
edit do
field :title
field :state do
sortable :name
end
field :school
...
end
create do; end
update do; end
end
No matter what I do, the states always appear id desc.
Any suggestions?
John