2012-08-17 14:40:57 +01:00
|
|
|
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
|
2012-08-28 17:57:12 +01:00
|
|
|
json.url api_v1_platform_path(platform.name, :format => :json)
|
2012-08-17 14:40:57 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
json.url api_v1_platforms_path(:format => :json)
|