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]
发布时间: 2012-12-19 14:13:14 作者: rapoo
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]