我想根据另一个下拉列表中的选项来过滤下拉列表项
<%= form_tag("/myAdmin", method: "post") do %>
<%= label_tag(:role_id, "Role: ")%>
<%= select_tag('Role', options_for_select(Role.all.map(&:name))) %> <br/>
<%= label_tag(:school_id, "School: ")%>
<%= select_tag('School', options_for_select(School.all.map(&:name) )) %> <br/>
<%= label_tag(:grade_id, "Grade: ")%>
<%= @grade = Grade.all
@grade1 = @grade.map {|a| if a.school_id == :school_id a}
select_tag('Grade', options_for_select(@grade1.map(&:name) )) %> <br/>
<%= submit_tag("Submit") %>
<% end %>
这是一个包含3个删除列表的表单。
我想根据所选择的学校过滤年级列表..
成绩模型有{school_id和name attributes},学校模型有{organization_id和name attributes}
我该怎么做?