0

我正在构建一个 Rails API 并使用 Netflix 的fast_jsonapi代码来序列化我的ActiveRecord对象:

class PerformancesController < ApplicationController

  def index
    render json: serialize(user.performances)
  end

  def serialize(data)
    PerformanceSerializer.new(data).serialized_json
  end

end

但是,当响应返回时,我必须使用以下命令访问数据response.data.data在此处输入图像描述

这对我来说似乎很尴尬。无论如何要删除其中一个数据吗?

4

0 回答 0