1
有沒有一種方法,我可以添加非模型元數據屬性到一個each_serializer
,而不使用:json_api
適配器?添加元數據:屬性串行器(活動模型序列化)
render json: invoices, each_serializer: Invoices::ItemizedSerializer
我想這是...
{
data: [{..invoice 1...}, {...invoice 2...}]
metadata: {total: 500}
}
,而不是
[
{..invoice 1...},
{...invoice 2...}
]