AtuThin - အတူသင်

has_many ဆက်သွယ်မှု — Post မှာ Comment အများကြီး

has_many ဆိုတာ belongs_to ရဲ့ တစ်ဖက်ခြမ်း ဖြစ်ပါတယ် — Post model မှာ has_many :comments လို့ ရေးရင် post.comments နဲ့ အဲဒီ post ရဲ့ comment အားလုံးကို ရပြီး post.comments.create(...) နဲ့ တွဲပြီး အသစ် ဆောက်နိုင်ပါတယ်။

သင်ခန်းစာ ရယူနေပါတယ်