Question

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
Was it helpful?

Solution

ActiveModelSerializer...!

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top