随笔分类 - Ruby on Rails
摘要:很基础,但是却搞很久,在这里总结一下。class User < ActiveRecord::Base has_many :borrows has_many :books, :through => :borrowsendclass Book < ActiveRecord::Base has_many :borrows has_many :users, :through => :borrowsendclass Borrow < ActiveRecord::Base belongs_to :user belongs_to :bookend非常基础的多对多关系模型,需要注
阅读全文

浙公网安备 33010602011771号