plymio_fontais v0.1.1 Elixir, Phoenix, CSRF tokens and gloomy foreteller

Encoding Ecto structs into JSON

Today’s episode covers one simple problem—how to encode Ecto structs into JSON.

There are a few ways to do it, but using @derive in the struct’s definition to implement the Poison.Encoder protocol is the cleanest way.