标签: activerecord ruby-on-rails-4 active-model-serializers
如何使用包含查询在JSON中呈现网格?下面的代码只输出文件夹。
Folder.includes(:grids) render json: @folders, :include => :grids, root: false
答案 0 :(得分:0)
ActiveModelSerializer ...!
class FolderSerializer< ::加载ActiveModel串行 attributes:id,:name,:grid 端