class Comment < ActiveRecord::Base
belongs_to :post
belongs_to :user
end
So with the above association can I fetch both user and post details from a given comment object?.
like
@comment.post.post_title and
@comment.user.user_name.
Also please note that I have used comment as a nested resource of post.
resources :posts do
resources :comments
end