【发布时间】:2014-12-17 00:11:14
【问题描述】:
我使用 gem 'i18n_country_select', '1.1.4' 进行国家/地区选择,但它不起作用,我已经按照他们的简短文档进行操作。 https://github.com/onomojo/i18n_country_select ..
或者,如果您有类似国家/地区选择的建议宝石,可能会对我有所帮助。
这是我的表格
<%= form_for([@user,@user_profile]) do |f| %>
<div>
<%= f.label :firstname, "Firstname" %>
<%= f.text_field :firstname %>
</div>
<div>
<%= f.label :lastname, "Lastname" %>
<%= f.text_field :lastname %>
</div>
<div>
<%= f.label :birthdate, "Birthdate" %>
<%= f.date_select :birthdate, :start_year => Date.current.year, :end_year => 1920 %>
</div>
<div>
<%= f.label :street_address, "Street" %>
<%= f.text_field :street_address %>
</div>
<div>
<%= f.label :city_address, "City" %>
<%= f.text_field :city_address %>
</div>
<div>
<%= f.label :country, "Country" %>
<%= f.country_code_select(:user_profile, :country) %>
</div>
<div>
<%= f.submit "Save Profile" %>
</div>
<% end %>
谢谢!
【问题讨论】:
-
你能发布你的错误吗?你不应该使用 =country_select 而不是 =f.country_select 吗?
标签: ruby-on-rails ruby ruby-on-rails-4 gem