diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-01 22:41:24 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-01 22:41:24 -0600 |
| commit | a5db20d0bad654ef25651eeb3a30ea64ce8c78d3 (patch) | |
| tree | 8e78c2cc4ee00198cccbfc4fe2786498b6862ad3 /app/controllers/api/v1/cakes_controller.rb | |
| parent | d8dd92a05114a1b704cae07e1716130aad0e7d62 (diff) | |
add destroy route to remove a cake via the api.
Diffstat (limited to 'app/controllers/api/v1/cakes_controller.rb')
| -rw-r--r-- | app/controllers/api/v1/cakes_controller.rb | 5 |
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 |
