Ruby on Rails Developer Question:
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.
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? |