0

我的表单中有此代码:

guidances/new.html.erb
<%= f.association :employee_department, as: :select %>
<%= f.input :guidance_supervisor do %>
  <%= f.select :guidance_supervisor, 
  Employee.where('guidance_supervisor' => true).map(&:full_name) %>
<% end %>

and when selecting a department I need to make the employees who belongs to that department appears, I'm using simple_form , what is the way to make this happen ?

4

1 回答 1

0

为此,您可以使用动态下拉概念。您可以在 rails 中查看动态下拉的以下帖子: Rails 中的
动态下拉。

于 2013-10-08T11:03:31.973 回答