Rails 3.1 interdependent select dropdown lists

孤街浪徒 提交于 2019-12-06 14:27:51

问题


My database structure:

Countries(id,title,prefix)  
Towns(id,country_id,title)
Street(id,town_id,title)

I need to create interdependent select dropdown list: when i select Country, ajax loading towns from this country into select tag, and when i select Street, ajax loading street by selected town_id into street select tag. I want to ask whether there is a Rails way to generate this list. Thank you.


回答1:


I found some tutorial to make what you want :

  • dependant dropdowns menus

  • cascading menu



来源:https://stackoverflow.com/questions/7351122/rails-3-1-interdependent-select-dropdown-lists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!