When I'm submitting the form, I get the following response:
{"data":{"attributes":{"title":null,"description":null},"type":"cards"}}
I'm not sure why I am getting title
and description
as null.
routes/cards/new.js
:
actions: {
save() {
const newCard = this.get('store').createRecord('card', this.get('model'));
newCard.save().then((card) => {
this.transitionTo('cards.all');
});
},
cancel() {
this.transitionTo('cards');
}
}
templates/cards/new.hbs
:
<form>
<div>
<label>Title:</label>
</div>
<div>
<label>Body:</label>
</div>
<div>
<button >Speichern</button>
<button >Abbrechen</button>
</div>
</form>
Repo link: http://ift.tt/1Xv7Dye
Aucun commentaire:
Enregistrer un commentaire