I came across this answer on StackOverflow which showed a beautiful solution for embedding tags with Active Model Serializers.
Say you have a blog and a blog has many tags. Your serializer might look something like:
class BlogSerializer < ActiveModel::Serializer embed :ids, include: true attributes :id, :name has_many :tags end
To deal with the ActsAsTaggableOn namespace, are tags serializer would look something like:
module ActsAsTaggableOn class TagSerializer < ActiveModel::Serializer attributes :id, :name end end
Now we just have to let Rails know that our has many association for tags will be using this serializer:
has_many :tags, serializer: ActsAsTaggableOn::TagSerializer
Now our tags are embedded with our blog.