Let\'s say you\'re implementing a REST API in Rails. When serving a collection, you might want to only include a few attributes:
/people
B
class CompletePersonSerializer < ActiveModel::Serializer root :person attributes :id, :name, :phone, :email end
or
render json: @people, each_serializer: CompletePersonSerializer, root: :person