summaryrefslogtreecommitdiff
path: root/app/views/api/v1/cakes/_cake.json.jbuilder
blob: cd84dc1c35d11557eabd1d54d7ddd0c6eb342e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
json.cache! ['v1', cake] do
  json.id cake.id
  json.name cake.name
  json.slug cake.to_param
  json.story cake.story
  json.created_at cake.created_at
  json.updated_at cake.updated_at
  json.category do
    json.id cake.category.id
    json.name cake.category.name
  end
  json.user do
    json.id cake.user.id
    json.name cake.user.name
  end
  json.photos cake.photos do |photo|
    json.id photo.id
    json.large_url "https:#{photo.url_for(:large)}"
    json.thumb_url "https:#{photo.url_for(:thumb)}"
    json.created_at photo.created_at
    json.updated_at photo.updated_at
  end
  json.tags cake.tags do |tag|
    json.name tag.name
  end
end