summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-07-01 22:41:24 -0600
committermo khan <mo@mokhan.ca>2014-07-01 22:41:24 -0600
commita5db20d0bad654ef25651eeb3a30ea64ce8c78d3 (patch)
tree8e78c2cc4ee00198cccbfc4fe2786498b6862ad3 /app/controllers/api
parentd8dd92a05114a1b704cae07e1716130aad0e7d62 (diff)
add destroy route to remove a cake via the api.
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/cakes_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/api/v1/cakes_controller.rb b/app/controllers/api/v1/cakes_controller.rb
index f33d2da0..62b9187b 100644
--- a/app/controllers/api/v1/cakes_controller.rb
+++ b/app/controllers/api/v1/cakes_controller.rb
@@ -35,6 +35,11 @@ module Api
respond_with(@cake = cake)
end
+ def destroy
+ current_user.creations.find(params[:id]).destroy!
+ render nothing: true
+ end
+
private
def cake_params