2
我有一篇文章模型和一個類別模型。類別充當樹。Formtastic +嵌套類別
構建選擇列表的最佳方法是什麼?允許管理員從選擇列表中選擇一個類別,以便稍後將其與文章關聯起來?
semantic_form_for(@article) do |f|
f.input :title, :as => :string
f.input :content, :as => :text
f.input :category, :collection => #what should go here ?
end
8年後,你有沒有想出解決辦法? :p – Tashows 2018-01-21 16:42:06