Use active_model_serializer with a non-ActiveRecord object
The model object needs to include it thusly: # active_model_serializers 0.10+ class ModelName include ActiveModel::Serialization end # active_model_serializers < 0.10 class ModelName include ActiveModel::SerializerSupport end This implements the methods needed within the object, and also auto-discovers the serializer matching the object name, so it can be used transparently just like an ActiveRecord object. This works … Read more