It's a matter of personal taste *where* you stash this attribute, but you will need to do this no matter how you handle the form submission. The comments controller has no particular notion of which post it is commenting on otherwise.
* You can put the post_id in the querystring when you link to the comment form, and capture it with a hidden variable in your new comment form.
* You can use nested routes to do the same thing in the body of the URL: posts/1234/comments/new
* I suppose you could stash it in a session cookie if you really object to the visual noise
* You could try using a nested form, but that gets hairy quite quickly if you have a public comment form (displayed on the posts/show route) and private edit both going through the posts/update route -- where do you redirect after, and where do you go on error during update?
The simplest possible thing, from way back to the 15-minute blog demo (whoops!) is to carry the post_id into the comments/new form in a querystring. It's not shameful or anything.