1

如何在country_selectorlocalized_country_select助手生成的下拉列表中预先选择一个国家?以下代码很好地创建了国家列表,但该:selected => :ch部分没有预选瑞士 (ch) 的预期效果:

<%= localized_country_select(:user, :country, [], :selected => :ch) %>

更新:以下似乎是实现这一目标的更好选择。

localized_country_select_tag(name, selected_value = nil, priority_countries = nil, html_options = {})
4

0 回答 0