Skip to content

Instantly share code, notes, and snippets.

@ankurkaushal
Created October 8, 2013 04:17
Show Gist options
  • Save ankurkaushal/6879379 to your computer and use it in GitHub Desktop.
Save ankurkaushal/6879379 to your computer and use it in GitHub Desktop.
App.js
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