我使用城市状态的宝石填充“国家和地区”下拉列表,以保存地址信息。 我想知道是否有一种方法可以将“最常使用/选择的”状态推到列表的顶部。
我想先按“选择最多的州”显示它们,然后按字母顺序显示所有州?
答案 0 :(得分:0)
不,gem当前没有这种过滤。 只有有关显示最后一个国家的信息:
When getting a city list, you can also specifies the country:
CS.cities(:sp, :br)
The country is an optional argument. city-state always uses the last country that you used.
https://github.com/loureirorg/city-state
您当然可以通过添加用于计数最常用的国家/城市的字段来升级gem ...