index.html.erb 1.1 KB

12345678910111213141516171819202122232425262728
  1. <%-
  2. province = '440000'
  3. city = '440300'
  4. district = '440305'
  5. provinces = ChinaCity.list
  6. cities = ChinaCity.list(province)
  7. districtes = ChinaCity.list(city)
  8. %>
  9. <div class='rails-helper city-group'>
  10. <%= select_tag :province, options_for_select(provinces, province) , prompt: '--省份--', class: ['city-select', 'city-province'] %>
  11. <%= select_tag :city , options_for_select(cities, city) , prompt: '--城市--', class: ['city-select', 'city-city'] %>
  12. <%= select_tag :district, options_for_select(districtes, district), prompt: '--地区--', class: ['city-select', 'city-district'] %>
  13. </div>
  14. <div class='html-tag city-group'>
  15. <select class='city-select city-province'>
  16. <option>--省份--</option>
  17. <%= options_for_select(ChinaCity.list, province) %>
  18. </select>
  19. <select class='city-select city-city'>
  20. <option>--城市--</option>
  21. <%= options_for_select(cities, city) %>
  22. </select>
  23. <select class='city-select city-district'>
  24. <option>--地区--</option>
  25. <%= options_for_select(districtes, district) %>
  26. </select>
  27. </div>