Skip to content

Instantly share code, notes, and snippets.

@sjmog
Forked from ankurkaushal/App.js
Created October 11, 2013 19:48
Show Gist options
  • Save sjmog/6940912 to your computer and use it in GitHub Desktop.
Save sjmog/6940912 to your computer and use it in GitHub Desktop.
App.ProjectController = Ember.ArrayController.extend({
)};
App.Project = App.Model.extend({
id : null,
projectname : null,
projectdesc : null,
projectbudget : null
});
App.ProjectRoute = Ember.Route.extend({
});
App.Project.reopenClass({
createNew : function() {
//Grab TextBox values and store them in dataString.
dataString = {
'projectname' : $("#projectname").val(), //These are the form fields
'projectdesc' : $("#projectdesc").val(),
'projectbudget' : $("#projectbudget").val()
};
console.log('check');
//Breakpoint for checking any inconsistencies
$.ajax({
type : "POST",
url : "http://pioneerdev.us/users/createNewProject",
data : dataString,
dataType : "json",
success : function(data) {
console.log('success');
alert('');
}
});
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment