Active_model_serializers: uninitialized constant ActiveModel::ArraySerializer

Created on 16 Jun 2016  路  1Comment  路  Source: rails-api/active_model_serializers

Hi, i'm trying to render a collection with ActiveModel::ArraySerializer but this raises the error: uninitialized constant ActiveModel::ArraySerializer

The version of AMS is 0.10.0

render json: { meta: { success: true, locale: I18n.locale }, collection: ActiveModel::ArraySerializer.new(@collection, each_serializer: MyCollectionSerializer)}, status: 200

Most helpful comment

Problem solved chaging from _ActiveModel::ArraySerializer.new_ to ActiveModel::Serializer::CollectionSerializer.new

>All comments

Problem solved chaging from _ActiveModel::ArraySerializer.new_ to ActiveModel::Serializer::CollectionSerializer.new

Was this page helpful?
0 / 5 - 0 ratings