Home »
MCQs »
Ruby on Rails MCQs
What is the difference between destroy and delete in Ruby on Rails?
28. What is the difference between destroy and delete?
- Delete runs any callbacks on the model while Destroy doesn't.
- Destroy runs any callbacks on the model while Delete doesn't.
Answer: B) Destroy runs any callbacks on the model while Delete doesn't.
Explanation:
Destroy and delete differ in a certain that destroy executes any callbacks on the model while delete does not.