質問

How do I render grids in JSON from includes query? The code below only outputs Folders.

Folder.includes(:grids)

render json: @folders, :include => :grids, root: false
役に立ちましたか?

解決

ActiveModelSerializer...!

class FolderSerializer < ActiveModel::Serializer attributes :id, :name, :grids end

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top