Active Model Serializer — Custom with Pagy Pagination

Dan Kaplan
2 min readFeb 16, 2021
You got to love Stock Images….

As opposed to just calling render json: @comments, we must specify our response and use this initializer to set our custom serializer.

To take this a step forward and to incorporate pagination with Pagy, we must do the following:

Right now I am rewriting and upgrading an app from a Rails Monolith to a Rails API and a React Front End. For this app…

--

--