diamond.js
Advanced tools
Comparing version 0.2.28 to 0.2.29
@@ -16,10 +16,12 @@ // Generated by CoffeeScript 1.8.0 | ||
Router.prototype.resource = function(name, callback) { | ||
this.get("/" + name, "" + name + "#index"); | ||
this.get("/" + name + "/:" + name, "" + name + "#show"); | ||
this.post("/" + name, "" + name + "#create"); | ||
this.put("/" + name + "/:" + name, "" + name + "#update"); | ||
this["delete"]("/" + name + "/:" + name, "" + name + "#destroy"); | ||
if (callback != null) { | ||
return this.route("/" + name, callback); | ||
} | ||
return this.route("/" + name, function() { | ||
if (callback != null) { | ||
callback.call(this); | ||
} | ||
this.get("/", "" + name + "#index"); | ||
this.get("/:" + name, "" + name + "#show"); | ||
this.post("/", "" + name + "#create"); | ||
this.put("/:" + name, "" + name + "#update"); | ||
return this["delete"]("/:" + name, "" + name + "#destroy"); | ||
}); | ||
}; | ||
@@ -39,15 +41,19 @@ | ||
Router.prototype.get = function(route, action) { | ||
return this.server.get("" + this.prefix + route, Router.route(this.action(action))); | ||
this.server.get("" + this.prefix + route, Router.route(this.action(action))); | ||
return console.log("GET " + this.prefix + route, action); | ||
}; | ||
Router.prototype.post = function(route, action) { | ||
return this.server.post("" + this.prefix + route, Router.route(this.action(action))); | ||
this.server.post("" + this.prefix + route, Router.route(this.action(action))); | ||
return console.log("POST " + this.prefix + route, action); | ||
}; | ||
Router.prototype.put = function(route, action) { | ||
return this.server.put("" + this.prefix + route, Router.route(this.action(action))); | ||
this.server.put("" + this.prefix + route, Router.route(this.action(action))); | ||
return console.log("PUT " + this.prefix + route, action); | ||
}; | ||
Router.prototype["delete"] = function(route, action) { | ||
return this.server["delete"]("" + this.prefix + route, Router.route(this.action(action))); | ||
this.server["delete"]("" + this.prefix + route, Router.route(this.action(action))); | ||
return console.log("DELETE " + this.prefix + route, action); | ||
}; | ||
@@ -54,0 +60,0 @@ |
{ | ||
"name": "diamond.js", | ||
"description": "Generic MVC web framework", | ||
"version": "0.2.28", | ||
"version": "0.2.29", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Arthur Xavier", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37194
518