You don’t need to use AMS. Just write your jbuilder responses to return data in the expected format:

# If embedding
json.posts(@posts) do |post|
json.extract!(post, :id, :body, :comment_ids)
end
json.comments(@comments) do |comment|
json.extract!(comment, :id, :body)
end
# If not embedding
json.posts(@posts) do |post|
json.extract!(post, :id, :body)
json.links do
json.comments post_comments_url(post)
end
end