An Amber built on top of a railway API JS application is available.
Ember.VERSION: 1.0.0 ember.js Debug: Handlebars.VERSION: It was originally running following 1.0.0 ember.js debug: jQuery.VERSION: 1.10.2 < / Code>but they have been updated to:
Amber: 1.7.1 + pre.f. 955455 ember.js Debuts: Amber Data: 1.0.0-beta .10 + canary.30d6bf849b ember.js Debug: Handlebars: 1.3.0 ember.js
using amber-rail gem
I I am falling into a bigger. Blocking issue while trying to save a section model. Each section is related to the line model:
line: DS.belongsTo ('line', {async: true})
and the row in return Model:
Category: DS.hasMany ('section', {async: true})
Saving a new section triggers the following function The controller line item is being sent through an object and is being sent in order to create an object before that object.
_createSection: function (row, new_section_data) {var store = this.get ('store'); New_section_data.width = this.getNewSectionWidth (line); New_section_data.position = this.getNewSectionPosition (line); New_section_data.row = Line; Var new_section = store.createRecord ('section', new_section_data); Console.log ('new_section return'); Console.log (new_section); . New_section.save () then (function () {console.log ('saved'); new_section.set ('set_as_selected', true); console.log ('save new_section post'); console.log (new_section); }, Function () {console.log ('save new section failure');}); Return new_section; },
As soon as the model is created, the problem occurs. This line is not really being implemented ideally in the model and hence the Rail API request is not working and this section is not being saved.
The data held in the new_section object before the create_rection request is as follows:
html: "& lt; p & gt; new section & lt; / p & gt;" Status: 3 line: class section_type_type: "text section" width: 6
This is the attached line square in the above code (with expanded _data node):
__ ember1414408746094: "ember791" __ember_meta__: object __nextSuper: undefined _attributes: object _changesToSync: object_data: object ID: 1 page: class page_id: 1 position: 1 sections: array [2] style: null __proto__: object _deferredTriggers: array [0] _hasHadSections: True_InFlightAttributes: Object_relationships: Object _updatingRecordArraysLater: false cunt Narrow: Container currentState: Object defaultStyleObject: Object ID: "1" store: Classroom updateTimeout: 7 __proto__: Class section_type_type: "TextSection" width: 6
However, following the new_section variable returned _data node:
_data: object contact_form_fields: array [0] created_at: "2014-10-27T11: 14: 39.000Z" deleted_at: empty gallery_images: array [0] header_view: false height : Zero HTML: "& lt; P & gt; New section & lt; / P & gt; "id: 21 status: 3 line: zero class_type_id: 19 section_type_type type:" text "style: empty updated_at:" 2014-10-271111: 14: 39.000Z "width: 6
Here you can see that the row value is zero.
I am having difficulty finding out (big) where this issue is going, it may be related to the amber data update (It was originally built using a very old version) But I'm scared I do not know how to change and why this is happening.
Any help will be very helpful, thanks.
Find one hand you are looking at the wrong place Do you set a row after creating a record, then does it work ? row
, another key in an object named _relationships
You should find row
, not in _data .
var store = this.get ('Store'); New_section_data.width = this.getNewSectionWidth (line); New_section_data.position = this.getNewSectionPosition (line); Var new_section = store.createRecord ('section', new_section_data); New_section.set ('line', line);
Comments
Post a Comment