diamond.js
Advanced tools
Comparing version 0.2.21 to 0.2.22
@@ -15,11 +15,11 @@ // Generated by CoffeeScript 1.8.0 | ||
Router.prototype.resource = function(name, param) { | ||
if (param == null) { | ||
param = "id"; | ||
} | ||
Router.prototype.resource = function(name, callback) { | ||
this.get("/" + name, "" + name + "#index"); | ||
this.get("/" + name + "/:" + param, "" + name + "#show"); | ||
this.get("/" + name + "/:" + name, "" + name + "#show"); | ||
this.post("/" + name, "" + name + "#create"); | ||
this.put("/" + name + "/:" + param, "" + name + "#update"); | ||
return this["delete"]("/" + name + "/:" + param, "" + name + "#destroy"); | ||
this.put("/" + name + "/:" + name, "" + name + "#update"); | ||
this["delete"]("/" + name + "/:" + name, "" + name + "#destroy"); | ||
if (callback != null) { | ||
return this.route(name, callback); | ||
} | ||
}; | ||
@@ -57,2 +57,5 @@ | ||
_ref = action.split('#'), controller = _ref[0], action = _ref[1]; | ||
if (Controller.controllers[controller].getInstance() == null) { | ||
throw "No Controller named " + controller + "Controller"; | ||
} | ||
return { | ||
@@ -59,0 +62,0 @@ controller: Controller.controllers[controller].getInstance(), |
{ | ||
"name": "diamond.js", | ||
"description": "Generic MVC web framework", | ||
"version": "0.2.21", | ||
"version": "0.2.22", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Arthur Xavier", |
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
35496
486