如何在country_select
orlocalized_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 = {})