Ruby on Rails Developer Question:
Download Questions PDF

Tell us what’s the difference between new, save and create?

Ruby on Rails Developer Interview Question
Ruby on Rails Developer Interview Question

Answer:

new – makes a new object but doesn’t save it to the database
save – saves the model. If the model is new a record gets created in the database, otherwise the existing record gets updated.
create – makes a new object and saves it to the database in one go

Download Ruby on Rails Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell us what are benefits of using Active Record as opposed to raw SQL queries?Tell us what is the use of super function in Ruby on Rails?