Code Explainers

Code explainers tagged #json api

ruby
class ArticleSerializer < ActiveModel::Serializer
  attributes :id, :title, :slug, :excerpt, :reading_time, :published_at, :url
 
  belongs_to :author, serializer: UserSerializer

Shaping API output with ActiveModel::Serializer in Rails

serialization json api computed attributes
Intermediate 9 steps