Gem china_region_fu 城市关联使用的问题

yeyong14 · September 09, 2013 · Last by Xuhao replied at September 12, 2013 · 2189 hits

按照Github上面的配置。在提交数据的时候报了下面的错

Province(#85512630) expected, got String(#78485020)

视图是这样的

<% form_for @product do |f| %>
<%= f.region_select [:province, :city, :district], province_prompt: 'Do', city_prompt: 'it', 
district_prompt: 'like this' %>
<% end %>

换成这个试试:

<%= f.region_select [:province_id, :city_id, :district_id], province_prompt: 'Do', city_prompt: 'it', 
district_prompt: 'like this' %>

https://github.com/Xuhao/china_region_fu/issues/8#issuecomment-24296232

You need to Sign in before reply, if you don't have an account, please Sign up first.