■ Understanding form ■ Understanding the association
■ Mac OS catalina ■ Ruby on Rails (5.2.4.2) ■ Virtual Box:6.1 ■ Vagrant: 2.2.7
form_for[@post, @comment].....
Hmm?
up until this point, form_for(@post)....
There was one argument, why two? ?? ??
In this case, because it is ** association **
Post: comment = 1: Many
So we need to give a value to both post and comment ...
So
that's all, If you have any corrections, please FB! !!
■ About comment function implementation https://qiita.com/tanaka-yu3/items/93d94b1ede8fb4be2981
■ About form_with https://qiita.com/tanaka-yu3/items/50f54f5d4f4b8dfe19f3
■ Method list https://qiita.com/tanaka-yu3/items/89abad875187494bec53
Recommended Posts