http://guides.rubyonrails.org/getting_started.html.
I notice they use it in section 7.4 three times, once in the comments controller and twice in show.html.erb but where is it defined?
Dont you need a
def comments
end
somewhere? Can you please explain how they are defining it?
Comments is not a method but a model that belongs_to the Post model.
When you call
@post.comments.build, this is creating comments in relation to a particular instance of the Post model.Go back and ready 7.2 again regarding associated models.