Closed Burgestrand closed 9 years ago
Closed with 6c9d8e799eef3e9da2adf34511fcafeceb7fe2e2.
A cool side-effect of this is that you can ALSO pass an on-the-fly serializer, similar to this:
render json: serialize(Person.first!) { |h, person|
h.attribute(:name, person.name)
}
I'm not sure what I think of this as a public API, so it remains an undocumented feature.
It's a small thing, but it makes for more consistent code in the controllers if the serializer needs to be changed.