3

my models in Datamapper are:

Project:

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

end

Task:

class Task

  include DataMapper::Resource

  property :id, Serial

  property :task_name, String

  belongs_to :project

end

Now i wanted to create view for the Project with links for adding tasks. I tried it with nested_form gem and cocoon gem but no use.

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
Deepak
  • 106
  • 6
  • Hey i solved this by using the solution found in The Pragmatic Bookshelf Rails Recipes book. Though the book covers mainly Rails2.3 but i was able to do it with Rails 3. – Deepak Jun 22 '11 at 09:35
  • Afaik the cocoon gem does not rely on activerecord (but truth be told: never tried to use datamapper). Could you show some code? – nathanvda Oct 15 '11 at 19:51
  • never mind. Our application moved to active-record and it's working great with cocoon gem. – Deepak Nov 23 '11 at 11:36

0 Answers0