Comment afficher le Has_many dans les rails de sérialiseur 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