Could someone suggest a guide/tutorial for implementing a dynamic select menu / cascading drop down in Rails using best practices? Or possibly recent * questions around the same topic. Possibly I'm searching the wrong terms.
有人能提供一个使用最佳实践在Rails中实现动态选择菜单/级联下降的指南/教程吗?或者最近的*关于同一个话题的问题。可能我找错词了。
I've taken a look at this railscast: #88 Dynamic Select Menus (revised) but am not convinced using a csv file to store the options is the best way to go about this.
我已经看过这个railscast: #88动态选择菜单(经过修改),但是我不相信使用csv文件来存储选项是最好的方法。
Everything else that I've found regarding dropdowns seems incomplete or outdated.
我发现的所有关于下拉的东西似乎都不完整或过时了。
1 个解决方案
#1
8
Alternatively you might be interested in this RESTful Rails 4 solution: Dynamic select boxes with Rails 4.
或者您可能对这个RESTful Rails 4解决方案感兴趣:动态选择带有Rails 4的框。
Basically, the select boxes are populated from the model, the controller adds an action to pick the coherent subset of data, and the view is refreshed through an AJAX request.
基本上,选择框是从模型中填充的,控制器添加一个操作来选择数据的一致子集,并且通过AJAX请求刷新视图。
#1
8
Alternatively you might be interested in this RESTful Rails 4 solution: Dynamic select boxes with Rails 4.
或者您可能对这个RESTful Rails 4解决方案感兴趣:动态选择带有Rails 4的框。
Basically, the select boxes are populated from the model, the controller adds an action to pick the coherent subset of data, and the view is refreshed through an AJAX request.
基本上,选择框是从模型中填充的,控制器添加一个操作来选择数据的一致子集,并且通过AJAX请求刷新视图。