DRYing the app

Learn how to apply the DRY principle to tidy up your application code.

We'll cover the following...

There are several parts of our application that share the same code. This goes against one of the principles of Rails: DRY.

So you will be going back and DRYing your application.

DRYing the actions

You may have noticed (params.require( :pet).permit( :name, :age, :description)) used in the update method is the same as you did for your create method. You can make this section cleaner by creating a private method that ...