Rails: Scaffold to automatically do one-to-many relationship

前端 未结 5 1559
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 10:55

Not sure if I\'m reading this right, but it seems like Scaffold will not do a one-to-many relationship in its entirety. For instance, if I create messages with

5条回答
  •  温柔的废话
    2020-12-09 11:34

    This is true, but, it's not the end of the story. There are at least two alternatives to Scaffold that both work quite well and automatically pick up on relationships between classes (based on your ActiveRecord relationship indicators like has_many). One of these alternatives is Streamlined and the other is ActiveScaffold.

    They're mainly helpful for entering in data that your system requires that is not user entered data. For example, I use them for administrative tasks on tables where there's no point in building a complete UI for CRUD when one of the scaffold alternatives will do the job just fine for a seldom used feature. You wouldn't want to use them for comments on messages though.

提交回复
热议问题