Skip to content

Commit 1b05ffc

Browse files
authored
Merge pull request rails#52317 from climatebrad/patch-1
Update `engines.md`: use `references` for generating `Comment` model [ci skip]
2 parents 861cf9d + 8964ec4 commit 1b05ffc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

guides/source/engines.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ model, a comment controller, and then modify the articles scaffold to display
440440
comments and allow people to create new ones.
441441

442442
From the engine root, run the model generator. Tell it to generate a
443-
`Comment` model, with the related table having two columns: an `article_id` integer
444-
and `text` text column.
443+
`Comment` model, with the related table having two columns: an `article` references
444+
column and `text` text column.
445445

446446
```bash
447-
$ bin/rails generate model Comment article_id:integer text:text
447+
$ bin/rails generate model Comment article:references text:text
448448
```
449449

450450
This will output the following:

0 commit comments

Comments
 (0)