I am using the JSONAPI format along with Active Model Serializers to create an api with rails-api.
I have a serializer which shows a specific post
that
Just make sure to return a hash or array of hashes like so:
def videos
object.listing_videos.collect do |lv|
{
id: lv.video.id,
name: lv.video.name,
wistia_id: lv.video.wistia_id,
duration: lv.video.duration,
wistia_hashed_id: lv.video.wistia_hashed_id,
description: lv.video.description,
thumbnail: lv.video.thumbnail
}
end
end