i trying view nested records rails console.
i have subarticles nested articles. in other words, subarticles belongs article, , articles has many subarticles.
i have tried article.subarticle.all
console doesn't work.
what best way go this?
if want view subarticles
1 particular article
, need assign variable:
a = article.find(1)
- assign article id = 1
and call: a.subarticles
- show subarticles
associated article
Comments
Post a Comment