Ruby on Rails Developer Question:

Download Job Interview Questions and Answers PDF

Tell me what’s the difference between destroy and delete?

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

Answer:

Both of these methods delete the record in the database. The different between them is that:

☛ destroy – checks and deletes connected records if necessary and calls callbacks i.e. before_destroy, after_destroy etc.
☛ delete – doesn’t call callbacks and removes an object directly from the database.

Download Ruby on Rails Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know who developed Rails?Tell us what is the purpose of the resources method in the code snippet below?