What is the difference between destroy and delete in Ruby on Rails?

28. What is the difference between destroy and delete?

  1. Delete runs any callbacks on the model while Destroy doesn't.
  2. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.