|
|
|
@ -15,6 +15,13 @@ app.controller('HeaderController', ['$http', function($http){
|
|
|
|
app.controller('TransgressionsController', ['$http', function($http){
|
|
|
|
app.controller('TransgressionsController', ['$http', function($http){
|
|
|
|
//get authenticity_token from DOM (rails injects it on load)
|
|
|
|
//get authenticity_token from DOM (rails injects it on load)
|
|
|
|
var authenticity_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
|
|
var authenticity_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
|
|
|
|
|
|
var controller = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get transgressions for current User
|
|
|
|
|
|
|
|
$http.get('/transgressions').success(function(data){
|
|
|
|
|
|
|
|
//just add the transgressions to the controller, data comes back with sinner as well
|
|
|
|
|
|
|
|
controller.current_user_transgressions = data.transgressions;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// create a transgression
|
|
|
|
// create a transgression
|
|
|
|
this.createTransgression = function(){
|
|
|
|
this.createTransgression = function(){
|
|
|
|
|