Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
function DJR() {
this.ajax = function(params, success, url, method) {
$.ajax({
params:params,
success: success,
url: url,
type: method
})
};
for(var action in this.routes){
this[action] = function(params, success){
this.ajax(params, success, );
}
}
}
function CursosController(){ DJR.apply(this); }
CursosController.prototype.routes = {
index: {
url: "/cursos", method: "GET"
},
create: {
url: "/cursos", method: "POST"
},
destroy: {
url: "/cursos/:id", method: "DELETE"
}
}
var cursos = new CursosController
cursos.create({ nome: "Teste" }, function(){});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.