From 56e7b088acbd583de76613fb1b4e07c7fe8d98bc Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 12 Oct 2015 10:46:13 -0700 Subject: [PATCH] Delete strains --- app/pods/protected/strains/show/controller.js | 11 +++++++++++ app/pods/protected/strains/show/template.hbs | 1 + 2 files changed, 12 insertions(+) create mode 100644 app/pods/protected/strains/show/controller.js diff --git a/app/pods/protected/strains/show/controller.js b/app/pods/protected/strains/show/controller.js new file mode 100644 index 0000000..ab4d552 --- /dev/null +++ b/app/pods/protected/strains/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.strains.index'); + }, + }, + +}); diff --git a/app/pods/protected/strains/show/template.hbs b/app/pods/protected/strains/show/template.hbs index e16634a..5260d43 100644 --- a/app/pods/protected/strains/show/template.hbs +++ b/app/pods/protected/strains/show/template.hbs @@ -105,4 +105,5 @@ {{#link-to 'protected.strains.edit' model.id class="button-gray smaller"}} Edit {{/link-to}} + {{delete-button delete=(action 'delete')}} {{/if}}