我在 Datamapper 中的模型是:
项目:
require "dm-accepts_nested_attributes"
class Project
include DataMapper::Resource
property :id, Serial
property :project_title, String
has n, :tasks
accepts_nested_attributes_for :tasks
结尾
任务:
class Task
include DataMapper::Resource
property :id, Serial
property :task_name, String
belongs_to :project
end
现在我想用添加任务的链接为项目创建视图。我用nested_form gem 和cocoon gem 试过,但没用。