ember.js - Emberjs, Target a model without leaving '/models' url -
I have a table of the model and I am able to click on my {{action} 'edit'}}
One of those models and amber will know in which model # is {{action 'edit'}}
is inside.
I am getting this error right now: 'GOT localhost: 3000 / category / undefined 404 (not found)'
Here my code is in '/ categories' path.
& lt; Tbody & gt; {{#each}} & lt; Tr square = "people-list" & gt; & Lt; TD & gt; & Lt; Input type = "checkbox" class = "toggle" & gt; {{#if} edit}} {{Amber. Textfield Manbanging = "name" name = "name"}} {{else}}
and then on the controller:
Actions: {edit: function () {this.set ('isEdit', true); }}
404 occurs when I
more models
VpcYeoman.Category = DS.Model.extend ({RecordCategoryID: DS.attr ('number'), name: DS ('string'), workflow: DS.attr ('string'), workflow: DS.belongsTo (' VpcYeoman.Calendar.FIXTURES = [{id: 0, RecordCategoryID: 0, name: "fire", project name: "Electra"}, classname, {polymorphic: true}, classnamebanking: ['admin']} {Id: 1, RecordCategoryID: 1, name: "water", projectname: "Nike"}];
and router.js
this. Resource ('categories', {path:' / categories'}); This.resource ('category', {path: '/ category / : Category_id '}, function () {this.route (' edit ');});
I was not sure that the router should add anything about' edit ' Because I did not want the program to change the URL to focus on a particular model.
Very easy solution, just send the model to action.
& lt; Img class = "table-img" {{action 'edit' this}} src = "images / pencil-gray.png" & gt; Actions: {edit: function (model) {model.set ('isEdit', true); }}
When you click on Link-To, it is being undefined by Amber to generate amber. This model is taking, then on the model for the creation of unique URL < Regardless of the code> category_id , you do not have that property on the model, so you have to fix your route by telling Amber that how to model your model. {Serialize: Function (model) {return {category_id: model.get ('id')}}}});
Comments
Post a Comment