CRUD Application: Part 1

We will create a simple application to learn how CRUD operations can be integrated into your applications.

Now that you understand the basics of CRUD in Rails, you can use them to set up a very simple application to perform the CRUD operation using web forms.

The app will display all the pets in your records, have links to show their details, and allow you to add and remove pets using web forms. Let’s get started!

Update the schema

Previously you had set up your application pet_store and generated a model with the attributes name, and age. Now we want to add a new attribute to this model called description. To do this you will modify your db/migrate/<date_time>_create_pets.rb file and add the following line:

t.text :description

This will create a new attribute called description with the type text.

Get hands-on with 1200+ tech skills courses.