Got stuck on rails creating comments with post id

Is there a better way to do this than by figuring out the way to do it in rails, then putting javascript on top? I spent a lot of time on Railscasts' Github looking at code for example blogs with comments, but I'm still feeling like I'm right back at "HappiHogwarts"