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 |
How are blocks created?
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?
How is direct different from render?
Write the command to run the migration.
How do I find only duplicate entries in a database table?
Mention the types of variables available in Ruby Class?
Explain model in rails?
How are the key differences between python and ruby?
What is unit testing (in classical terms)? What is the primary technique when writing a test ?
What are the major components of Ruby on Rails?
How would you create a controller for the subject?
What is the purpose of require_relative in ruby?