what is the difference between destroy and delete?



what is the difference between destroy and delete?..

Answer / Sonia Verma

In Rails, 'delete' is an HTTP verb used in RESTful applications to remove a resource. When you call 'destroy' on an ActiveRecord model, it calls the 'delete' action of its corresponding controller, which typically performs actions like setting the object as deleted and soft-deleting or hard-deleting the record from the database.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

How are blocks created?

1 Answers  


If you want to set up a one-to-one relationship between two models, you'll need to add belongs_to to one, and has_one to the other. How do you know which is which?

1 Answers  


How is direct different from render?

1 Answers  


Write the command to run the migration.

1 Answers  


How do I find only duplicate entries in a database table?

1 Answers  


Mention the types of variables available in Ruby Class?

1 Answers  


Explain model in rails?

1 Answers  


How are the key differences between python and ruby?

1 Answers  


What is unit testing (in classical terms)? What is the primary technique when writing a test ?

1 Answers  


What are the major components of Ruby on Rails?

1 Answers   QualTech,


How would you create a controller for the subject?

1 Answers  


What is the purpose of require_relative in ruby?

1 Answers  


Categories