I've been stuck on a problem with nested models.  I need to set the
default for the belongs_to

I've created two models, Book and Chapter.  Book has a title:string.
Chapter has a chapter_name:string.

/app/models/book.rb contains  has_many :chapters, :accessible =>
true, :dependent => :destroy
/app/models/chapter.rb contains belongs_to :book

When I create a new book I get these fields:

Book Title: [                   ]
Chapters:   Chapter Name: [                 ]   [+]
                  Book: [ ]

I get the <input-many> created automatically to add new Chapters in
the book.

How can I automatically assign these new Chapters to this Book?
Can I hide the Book: [ ] field?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to