2015-04-12 136 views
0

我想选择一个SuperCategory,然后过滤掉MainCategories的下拉菜单。我收到以下错误动态选择菜单

未定义的方法`图”:main_categories:符号

与代码

<%= select_tag 'main_category_id', grouped_collection_select(:main_category_id, SuperCategory.active.order(:title), :main_categories, :title, :id, :title, include_blank: false) %> 
+0

工作你是说你想有两个选择?第二选择中的值取决于第一选择中选择的值? –

回答

0

这结束了对

<%= grouped_collection_select('grouped', :main_category_ids, SuperCategory.exclude_most_popular, 'sort_main_categories', :title, :id, :title, { :selected => selected_main, include_blank: false }) %>