2015-04-12 122 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 }) %>