Generating a model with many to many in Ruby on Rails

前端 未结 3 1883
深忆病人
深忆病人 2021-02-07 12:31

Is there a way to generate a Rails model with a many to many relationship predefined? I know how to add it to the Active Record after the fact but it would be nice to have it de

3条回答
  •  再見小時候
    2021-02-07 13:19

    Please look at this question first: Creating a many-to-many relationship in Rails 3.

    In addition, I would recommend next book "Ruby on Rails 3 Tutorial: Learn Rails by Example" for a better understanding of ActiveRecord relations.

提交回复
热议问题