From bf8289436f0bd0288ac7c5006ffd734584d4d83f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 12 Oct 2015 10:41:07 -0700 Subject: [PATCH] Delete species --- app/pods/protected/species/show/controller.js | 11 +++++++++++ app/pods/protected/species/show/template.hbs | 1 + 2 files changed, 12 insertions(+) create mode 100644 app/pods/protected/species/show/controller.js diff --git a/app/pods/protected/species/show/controller.js b/app/pods/protected/species/show/controller.js new file mode 100644 index 0000000..cadc1f4 --- /dev/null +++ b/app/pods/protected/species/show/controller.js @@ -0,0 +1,11 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ + actions: { + delete: function() { + this.get('model').destroyRecord(); + this.transitionToRoute('protected.species.index'); + }, + }, + +}); diff --git a/app/pods/protected/species/show/template.hbs b/app/pods/protected/species/show/template.hbs index 059ab04..528b969 100644 --- a/app/pods/protected/species/show/template.hbs +++ b/app/pods/protected/species/show/template.hbs @@ -62,4 +62,5 @@ {{#link-to 'protected.species.edit' model class="button-gray smaller"}} Edit {{/link-to}} + {{delete-button delete=(action 'delete')}} {{/if}}