rosa-build/app/views/api/v1/platforms/index.json.jbuilder

12 lines
449 B
Plaintext
Raw Normal View History

json.platforms @platforms do |json, platform|
json.(platform, :id, :name, :platform_type, :visibility)
json.owner do |json_owner|
json_owner.(platform.owner, :id, :name)
json_owner.type platform.owner_type
json_owner.url platform.owner_type == 'User' ? user_path(platform.owner) : group_path(platform.owner)
end
json.url api_v1_platform_path(platform.name, :format => :json)
end
json.url api_v1_platforms_path(:format => :json)