Create a Genre

Learn how to implement controllers, models, and routes to add a new entry to the genre.

Introduction

This section will cover everything related to creating and managing movie genres. We'll concentrate on creating controllers, models, and routes that communicate with one another to accomplish the necessary tasks.

Setting up the genre model

In the models folder, we add a file called genreModel.go. This file contains the genre struct and the parameters we want to obtain from the administrator.

The administrator only needs to input the genre name, and we’ll also require that the parameter always be passed. The genre struct should look as follows:

Get hands-on with 1400+ tech skills courses.