#Active-Model-Serializers
2 notas · última:
To Serialize or Not to Serialize: ActiveModel Serializers
The post explains why a Rails API response should be serialized for a JavaScript front end, then shows how ActiveModel Serializers lets you whitelist fields, shape associations, and customize JSON output.
Avoid Rails When Generating JSON responses with PostgreSQL
The article argues that moving JSON generation into PostgreSQL removes expensive Ruby object creation and Rails serialization work, cutting response times and memory use for API payloads.
