summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2017-10-07 15:33:33 -0600
committermo <mo.khan@gmail.com>2017-10-07 15:33:33 -0600
commit0a40d930732ee933c9bd6acd5aca21cae8e26717 (patch)
tree3814f9d7b6c245e064161c4a901e5ed9a22e31a2 /app/views
parent6e36c75f480be84dc904a2e37dffb3642cc95356 (diff)
load all collections using backbone_collection_for helper.HEADmaster
Diffstat (limited to 'app/views')
-rw-r--r--app/views/application/json/_photos.jbuilder13
-rw-r--r--app/views/my/kitchens/show.html.erb2
2 files changed, 15 insertions, 0 deletions
diff --git a/app/views/application/json/_photos.jbuilder b/app/views/application/json/_photos.jbuilder
new file mode 100644
index 00000000..f7b6be48
--- /dev/null
+++ b/app/views/application/json/_photos.jbuilder
@@ -0,0 +1,13 @@
+json.array! @photos do |photo|
+ json.cache! ['v1', photo] do
+ json.id photo.id
+ json.cake_id photo.imageable_id
+ json.content_type photo.content_type
+ json.original_filename photo.original_filename
+ json.thumb_url photo.url_for(:thumb)
+ json.large_url photo.url_for(:large)
+ json.original_url photo.url_for(:original)
+ json.created_at photo.created_at
+ json.updated_at photo.updated_at
+ end
+end
diff --git a/app/views/my/kitchens/show.html.erb b/app/views/my/kitchens/show.html.erb
index 13d42a9f..263cd97c 100644
--- a/app/views/my/kitchens/show.html.erb
+++ b/app/views/my/kitchens/show.html.erb
@@ -10,7 +10,9 @@
<%= backbone_collection_for @categories %>
<%= backbone_collection_for @tags %>
+<%= backbone_collection_for @cakes %>
<%= backbone_collection_for @tutorials %>
+<%= backbone_collection_for @photos %>
<%= javascript_tag do %>
csx.initialize({ access_token: '<%= current_user.authentication_token %>' });