master
1module Api
2 module V1
3 class PhotosController < ApiController
4 def index
5 @photos = current_user.creations.find(params[:cake_id]).photos
6 end
7
8 def show
9 @photo = current_user.creations.find(params[:cake_id]).photos.find(params[:id])
10 end
11
12 def create
13 cake = current_user.creations.find(params[:cake_id])
14 @photo = UploadPhoto.new(cake).run(params)
15 end
16 end
17 end
18end