Ruby on Rails Developer Question:
Download Job Interview Questions and Answers PDF
Tell me what’s the difference between destroy and delete?
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.
☛ 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 Question | Next Question |
Do you know who developed Rails? | Tell us what is the purpose of the resources method in the code snippet below? |