diff --git a/app/pods/species/edit/controller.js b/app/pods/species/edit/controller.js
index ca6b05f..463392e 100644
--- a/app/pods/species/edit/controller.js
+++ b/app/pods/species/edit/controller.js
@@ -3,7 +3,7 @@ import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
- let species = this.get('species');
+ let species = this.get('model');
if (species.get('isDirty')) {
species.save().then((species) => {
@@ -17,7 +17,7 @@ export default Ember.Controller.extend({
},
cancel: function() {
- let species = this.get('species');
+ let species = this.get('model');
species.get('errors').clear();
species.rollback();
diff --git a/app/pods/species/edit/route.js b/app/pods/species/edit/route.js
index b73792b..b3f843f 100644
--- a/app/pods/species/edit/route.js
+++ b/app/pods/species/edit/route.js
@@ -1,14 +1,4 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
-export default Ember.Route.extend(AuthenticatedRouteMixin, {
- model: function(params) {
- return Ember.RSVP.hash({
- species: this.store.find('species', params.species_id),
- });
- },
-
- setupController: function(controller, model) {
- controller.setProperties(model);
- },
-});
+export default Ember.Route.extend(AuthenticatedRouteMixin, {});
diff --git a/app/pods/species/edit/template.hbs b/app/pods/species/edit/template.hbs
index 6a8db9b..5c6c82f 100644
--- a/app/pods/species/edit/template.hbs
+++ b/app/pods/species/edit/template.hbs
@@ -1,6 +1,6 @@
{{
forms/species-form
- species=species
+ species=model
save="save"
cancel="cancel"
}}
diff --git a/app/pods/species/index/template.hbs b/app/pods/species/index/template.hbs
index 225fa79..12cd6d8 100644
--- a/app/pods/species/index/template.hbs
+++ b/app/pods/species/index/template.hbs
@@ -15,8 +15,7 @@
- {{!-- use species.id to call show model hook --}}
- {{#link-to 'species.show' species.id}}
+ {{#link-to 'species.show' species}}
{{species.speciesName}}
{{/link-to}}
diff --git a/app/pods/species/new/controller.js b/app/pods/species/new/controller.js
index 2781a83..568648f 100644
--- a/app/pods/species/new/controller.js
+++ b/app/pods/species/new/controller.js
@@ -3,7 +3,7 @@ import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
- let species = this.get('species');
+ let species = this.get('model');
if (species.get('isDirty')) {
species.save().then((species) => {
@@ -17,7 +17,7 @@ export default Ember.Controller.extend({
},
cancel: function() {
- let species = this.get('species');
+ let species = this.get('model');
if (species.get('isNew')) {
species.deleteRecord();
diff --git a/app/pods/species/new/route.js b/app/pods/species/new/route.js
index e816ab5..98741c6 100644
--- a/app/pods/species/new/route.js
+++ b/app/pods/species/new/route.js
@@ -3,13 +3,7 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
- return Ember.RSVP.hash({
- species: this.store.createRecord('species'),
- });
- },
-
- setupController: function(controller, model) {
- controller.setProperties(model);
+ return this.store.createRecord('species');
},
});
diff --git a/app/pods/species/new/template.hbs b/app/pods/species/new/template.hbs
index 6a8db9b..5c6c82f 100644
--- a/app/pods/species/new/template.hbs
+++ b/app/pods/species/new/template.hbs
@@ -1,6 +1,6 @@
{{
forms/species-form
- species=species
+ species=model
save="save"
cancel="cancel"
}}
diff --git a/app/pods/species/show/controller.js b/app/pods/species/show/controller.js
deleted file mode 100644
index 2d5a523..0000000
--- a/app/pods/species/show/controller.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Controller.extend({
- isEditing: false,
- actions: {
- save: function() {
- var species = this.get('model');
- if (species.get('isDirty')) {
- species.save();
- }
- this.toggleProperty('isEditing');
- },
- cancel: function() {
- if (this.get('isEditing')) {
- var species = this.get('model');
- species.get('errors').clear();
- species.rollback();
- }
- this.toggleProperty('isEditing');
- }
- }
-});
diff --git a/app/pods/species/show/route.js b/app/pods/species/show/route.js
index b73792b..b3f843f 100644
--- a/app/pods/species/show/route.js
+++ b/app/pods/species/show/route.js
@@ -1,14 +1,4 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
-export default Ember.Route.extend(AuthenticatedRouteMixin, {
- model: function(params) {
- return Ember.RSVP.hash({
- species: this.store.find('species', params.species_id),
- });
- },
-
- setupController: function(controller, model) {
- controller.setProperties(model);
- },
-});
+export default Ember.Route.extend(AuthenticatedRouteMixin, {});
diff --git a/app/pods/species/show/template.hbs b/app/pods/species/show/template.hbs
index 0d1c47a..11b72ba 100644
--- a/app/pods/species/show/template.hbs
+++ b/app/pods/species/show/template.hbs
@@ -2,7 +2,7 @@
@@ -31,7 +31,7 @@
- Etymology
-
- {{species.etymology}}
+ {{model.etymology}}
@@ -40,15 +40,15 @@
- Record Created
- - {{null-time species.createdAt 'LL'}}
+ - {{null-time model.createdAt 'LL'}}
- Record Updated
- - {{null-time species.updatedAt 'LL'}}
+ - {{null-time model.updatedAt 'LL'}}
- Record Deleted
- - {{null-time species.deletedAt 'LL'}}
+ - {{null-time model.deletedAt 'LL'}}
|