我正在尝试调用自定义方法让我们说'get_divisions_by_school_id'并将变量传递给simple_form_for中的该方法
我想在以下代码中调用 :get_divisions_by_school_id(@school.id) 而不是 :divisions:
<%= f.grouped_collection_select(:division_id, @teacher.standards, :divisions, :id, :id, :name, {:class => "input-box-width1", :required => true},{:multiple=>true}) %>
我想要类似的东西:
<%= f.grouped_collection_select(:division_id, @teacher.standards, :get_divisions_by_school_id(@school.id), :id, :id, :name, {:class => "input-box-width1", :required => true},{:multiple=>true}) %>