I\'m creating a forum website, where each registered user can write many posts and
each post can have many comments.
Also each user can comment on any posts created by a
Since your post has many comments, so it is post.comments
instead of post.comment
Since comments
is a list of comments, comments.user
is not valid also.
You will need the comment's id so that you could find the specific comment's user:
post.comments.find(params[:id]).user
of course, you could also get all users:
post.comments.all.collect(&:user)