【发布时间】:2011-03-02 19:04:02
【问题描述】:
我有一个文章模型和一个类别模型。类别充当树。
构建选择列表以允许管理员从选择列表中选择一个类别以便稍后将其与文章关联的最佳方法是什么?
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
标签: ruby-on-rails nested-sets formtastic