has_many 关联关系表单 交付
has_many 关联关系表单 提交
class Author
has_many :books
end
class Book
belongs_to :author
end
author = Author.create(:name => "zcy", :book_ids => [1,2,3])
author.books.collect(&:id) => [1,2,3]
class Author
has_many :books
end
class Book
belongs_to :author
end
author = Author.create(:name => "zcy", :book_ids => [1,2,3])
author.books.collect(&:id) => [1,2,3]