Json JBuilder array from key value pairs

93 Views Asked by At

In my current JSON output I have key value pair like this

"genres":[{"id":3,"name":"Biography"},{"id":1,"name":"Drama"},{"id":5,"name":"History"}]

and I want it to look like this.

"genres":["Biography", "Drama", "History"]

the closest I've gotten is this

"genres":[]

Seems relatively simple but I've tried a combination of things and I cannot get it to work. Anyone have any ideas?

0

There are 0 best solutions below