我有一个下拉菜单:
<div class="form-group">
<label for="usr">Degree Type:</label>
<%= f.select(:degreetype, options_for_select([['Bachelor Degree'],['Masters Degree'],['PHD']]),{}, {class:"form-control"})%>
</div>
根据上面的选择,我想要不同的下拉列表
#if Bachelor Degree selected
<div class="form-group">
<label for="usr">level:</label>
<%= f.select(:level, options_for_select([['1st'],['2.1'],['2.2'],['3rd']]),{}, {class:"form-control"})%>
</div>
#if Master Degree selected
<div class="form-group">
<label for="usr">level:</label>
<%= f.select(:level, options_for_select([['1st'],['2.1'],['2.2'],['3rd']]),{}, {class:"form-control"})%>
</div>
:degreetype
是字符串数据类型。