0

我的表单中有一个 collection_select:

<%= rf.collection_select :u_org, Org.all, :id, :name %>

我想要从此表单助手中选择的值,以便我可以根据此选择填充另一个 collection_select,例如:

<% @org = Org.find_by_id(##the selected id##) %>

以便填充:

<%= rf.collection_select :depart, @org.departments, :id, :department_name %>

我试过了

<% @org = Org.first %>

它工作得很好。请帮忙。

4

0 回答 0