action to create a confession

angular
Matt Huntington 10 years ago
parent 21753eeb9a
commit 164724c90e

@ -65,8 +65,15 @@ app.controller('TransgressionsController', ['$http', function($http){
}
this.createConfession = function(transgression_id){
console.log(this);
console.log(this.newConfessionDescription);
console.log(this.newConfessionDate);
$http.post('/transgressions/'+transgression_id+'/confessions', {
//include authenticity_token
authenticity_token: authenticity_token,
confession: {
description: this.newConfessionDescription,
occurred_at: this.newConfessionDate
}
}).success(function(data){
console.log(data)
});
}
}]);

Loading…
Cancel
Save