CRUD Application: Part 3
Learn to add the update and delete functionality to your application.
So far, your app allows you to perform the C and R of the CRUD operations. We can look at existing pets, retrieve their details, and create new ones.
Next, you will learn how to perform the U and D on our app. Here are the steps you will follow:
- Edit the
edit
action inapp/controllers/pets_controller.rb
to take you to the edit view - Edit
edit.html.erb
to display the form to edit existing pets.3. Create anupdate
method inapp/controllers/pets_controller.rb
to handle form updates - Edit
index.html.erb
andshow.html.erb
to display Edit links - Create a
destroy
method to handle pet removal - Edit
index.html.erb
andshow.html.erb
to display Remove links
Get hands-on with 1200+ tech skills courses.