Permalink
Browse files

Make the doc regarding RESTful routes clearly include the file extens…

…ion.
  • Loading branch information...
1 parent b6db800 commit b563a1c8ebf633ee85d5c1714384068ef30eded4 @mde mde committed May 4, 2010
Showing with 22 additions and 4 deletions.
  1. +4 −4 README.markdown
  2. +18 −0 geddy-util/lib/string.js
View
@@ -147,16 +147,16 @@ GET */snow_dogs/add*<br/>
(SnowDogs controller, add action, for any new-resource template
-- "new" is not usable as a JavaScript action name)
-POST */snow_dogs*<br/>
+POST */snow_dogs[.extension]<br/>
(SnowDogs controller, create action)
-GET */snow_dogs/:id*<br/>
+GET */snow_dogs/:id[.extension]<br/>
(SnowDogs controller, show action)
-PUT */snow_dogs/:id*<br/>
+PUT */snow_dogs/:id[.extension]<br/>
(SnowDogs controller, update action)
-DELETE */snow_dogs/:id*<br/>
+DELETE */snow_dogs/:id[.extension]<br/>
(SnowDogs controller, remove action)
A simple controller that just responds with any
View
@@ -137,6 +137,24 @@ util.string = new function () {
return s.substr(0, 1).toUpperCase() + s.substr(1);
};
+ // From Math.uuid.js, http://www.broofa.com/Tools/Math.uuid.js
+ // Robert Kieffer (robert@broofa.com), MIT license
+ this.uuid = function () {
+ var chars = CHARS, uuid = [], rnd=0, r;
+ for (var i = 0; i < 36; i++) {
+ if (i==8 || i==13 || i==18 || i==23) {
+ uuid[i] = '-';
+ } else {
+ if (rnd <= 0x02) rnd = 0x2000000 + (Math.random()*0x1000000)|0;
+ r = rnd & 0xf;
+ rnd = rnd >> 4;
+ uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
+ }
+ }
+ return uuid.join('');
+ };
+
+
}();
if (typeof exports != 'undefined') {

0 comments on commit b563a1c

Please sign in to comment.