Jak wyświetlić HAS_MANY w szynach Serializer API
class ProjectGroupSerializer < ActiveModel::Serializer
attributes :id, :name, :description, :projects
def projects
object.projects.map do |project|
::ProjectSerializer.new(project).attributes
end
end
end
Thoughtful Tarsier