I am currently using Ember 1.3.1 and Ember-Data. I currently use the getJSON to retrieve my data using GET from a URL. An example is shown below:
App.ProcessCreateRoute = Ember.Route.extend({
model: function() { return Ember.$.getJSON('/ProcessManager/manage? type=forms&action=list').then(function(data) { var forms = [];
$.each(data.forms, function() { forms.push(this); }); return forms;
I use another GET request to place data on my server by triggering a controller action in EmberJS. E.g. if I want to add a new form I do:
$.ajax({type: 'GET', url: formulateURL, dataType: 'json'});
As you can see I get the URL and just append the values in my form and send to the server.
Can anyone please tell me how I can translate this into Ember Data? I currently don't use it but how do you choose the URL to place data on the server and the URL to get data?
To place data on the server I use this URL and append data afterwards:
/ProcessManager/manage?type=processes&action=add
To get data from the server I use the URL:
/ProcessManager/manage?type=forms&action=list
Has anyone got any ideas of first steps I can do?