I have a serializer FooSerializer
serializing my model Foo
. The serializer works. But in one of my controller I do a render json: { key: [foo_1, foo_2] }
and the instances foo_1
and foo_2
are not serialized with FooSerializer
(only a to_json
is called I guess).
How to do it with a cleaner way than calling FooSerializer
specifically on each item of the array ?
Thanks !