Difference between delete & destroy in RoR?

The delete method simply deletes the record based on the records primary key and no call backs will be performed.

Destroy method deletes the record from the database and can execute the callbacks if any like before_destroy, after_destroy and observer methods and any dependent records.

No comments:

Post a Comment