MCQs > IT & Programming > Ruby On Rails > In a has_many association, what is the difference between build and new? // user.rb has_many :posts // post.rb belongs_to :user

Ruby On Rails MCQs

In a has_many association, what is the difference between build and new?
// user.rb
has_many :posts
// post.rb
belongs_to :user

Answer

Correct Answer: 'build' sets the foreign key and adds it to the collection.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Ruby On Rails Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ruby On Rails Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it