Serialize Product
Learn how to serialize the Product model to get the desired JSON output.
Now that we understand how the serialization gem works, it’s time to customize the product output.
Generate a serializer for the Product
model
The first step is the same as what we
did in the previous lesson. We need a serializer for the Product
model, so let’s create one using the command in the terminal below:
$ rails
...