0
I have a dynamic select of states and cities and my idea is to list the state capital selected first.
I have the following code to list the cities but not listing the capital first:
@cidades = Cidade.where("estado_id = ?", Estado.first.id).order(id: Estado.select(:capital))
recalling that the capital is an attribute of the integer state table