Does rails scaffold command support generate belongs_to or many to many model middle table migration info?
问题 Product,Category is two model on rails3 the relation between them are follow: product has_and_belongs_to_many categories category has_and_belongs_to_many products i can use scaffold generate migration for this two modle use rails g scaffold product name:string rails g scaffold category name:string but how can i generate the many to many model's middle table migration info,or i need write it manually,if so this is hard for me,hope someone could help me. 回答1: You need create this table by