tag:strokedb.lighthouseapp.com,2008-04-30:/projects/10596-zoid/eventsstrokedb / Zoid Events2008-04-30T09:19:05Ztag:strokedb.lighthouseapp.com,2008-04-30:Event/16252562008-10-31T22:55:28+02:002008-10-31T22:55:28+02:00Oleg AndreevNew Zoid Project MemberOleg Andreev has been given access to the Zoid Project.tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778892008-05-03T12:54:10+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778762008-05-03T12:44:51+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778742008-05-03T12:44:36+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778732008-05-03T12:44:21+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778722008-05-03T12:39:41+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778702008-05-03T12:38:44+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778652008-05-03T12:30:16+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5778642008-05-03T12:29:42+03:002008-05-03T12:54:10+03:00Yurii Rashkovskii[Page] Zoid: Routing<div><p>
<em>(This document is WIP and I am open for suggestions. This document is definitely incomplete atm)</em>
</p><p>
Zoid routing is supposed to be hard-coded (this might change eventually, but lets forget about it now). The reasons are simplicity and speed.
</p><p>
Each request to Zoid app is matched against following criteria:
</p>
<ul><li>
request method (PUT and DELETE are transparently tunneled through POST and _method parameter)
</li><li>
full request path
</li></ul>
<h2>
Routing Patterns
</h2>
<p>
Here is the list of Zoid routes I foresee now:
</p>
<ul><li>
GET /plural_meta_name
</li></ul>
<p>
Example: GET /users
</p><p>
This request is routed to User.index (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#index shipped with Zoid will handle it.
</p>
<ul><li>
POST /plural_meta_name
</li></ul>
<p>
Example: POST /users
</p><p>
This request is routed to User.create!()
</p>
<ul><li>
PUT /plural_meta_name
</li></ul>
<p>
Example: PUT /users
</p><p>
This request is routed to User.document.update_slots! probably. <strong>I am not sure it is a good idea to allow editing meta document, but we'll see</strong>
</p>
<ul><li>
GET /plural_meta_name/method_name
</li></ul>
<p>
Example: GET /users/new
</p><p>
This request is routed to User.new (class method). Since Zoid extends Meta with its own set of methods, if User has no <em>index</em> method then Meta#new shipped with Zoid will handle it.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000
</p><p>
This request is routed to User.find(uuid,version).show method. Since Zoid extends Document with its own set of methods, if User has no <em>show</em> method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
GET /plural_meta_name/uuid(.version)/edit
</li></ul>
<p>
Example: GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/edit or GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e.00000000-0000-0000-0000-000000000000/edit
</p><p>
This request is routed to User.find(uuid,version).edit method. Since Zoid extends Document with its own set of methods, if User has no edit method then Document#show shipped with Zoid will handle it and render it with default layout.
</p>
<ul><li>
PUT /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: PUT /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).update_attributes! method. If version is included into request, then versioned document is updated
</p>
<ul><li>
POST /plural_meta_name/uuid(.version)
</li></ul>
<p>
Example: POST /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).set_attributes! method. If version is included into request, then versioned document is updated
</p><p>
(Note: there is no #set_attributes! method yet)
</p><p>
This method differs from PUT one in one simple aspect: while in PUT you should specify only those slots you want to update, in POST you're creating new version from scratch.
</p><p>
Note: I am not yet sure we need this method of document update
</p>
<ul><li>
DELETE /plural_meta_name/uuid
</li></ul>
<p>
Example: DELETE /users/02c231fa-eef3-416a-a51d-e543abcd6d4e
</p><p>
This request is routed to User.find(uuid,version).delete! method
</p>
<h2>
Specifying arguments
</h2>
<p>
Each request, like GET /plural_meta_name/uuid(.version)/edit, GET /plural_meta_name/method_name, etc. can accept extra arguments. Rules are simple enough: all values separated by slash ('/') until question mark ('?') are considered to be usual method arguments; all request parameters are assumed to be a Hash and passed to method as a last argument.
</p><p>
So, for example, GET /users/02c231fa-eef3-416a-a51d-e543abcd6d4e/items/0?theme=new will be translated to User#items(0, 'theme' => 'new')
</p>
<h2>
Some notes:
</h2>
<ul><li>
Security issues are to be addressed in another document
</li><li>
Each request path could be appended with "file extension" to specify format explicitely without tuning Accept: header (aspects of multi-format rendering will be addressed in another document)
</li></ul></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5677342008-05-01T07:38:13+03:002008-05-01T07:38:13+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [5fa78ef541fcc5fdeed5a6e4a9e3a1cd570c7332] by Yurii Rashkovskii<div><p>
Initial DocumentNotFound routing has been added
</p><p>
<a href="http://github.com/yrashk/zoid/commit/5fa78ef541fcc5fdeed5a6e4a9e3a1cd570c7332">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5676652008-05-01T07:18:20+03:002008-05-01T07:18:20+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [4644ec5255fd548bb8c8ed0303d3937df09f2a1d] by Yurii Rashkovskii<div><p>
View routing
</p><p>
<a href="http://github.com/yrashk/zoid/commit/4644ec5255fd548bb8c8ed0303d3937df09f2a1d">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5676482008-05-01T07:08:01+03:002008-05-01T07:08:01+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [9aac0cf6842f71ccc8bd8732341bbcd3c07a7051] by Yurii Rashkovskii<div><p>
More primitive routing has been added
</p><p>
<a href="http://github.com/yrashk/zoid/commit/9aac0cf6842f71ccc8bd8732341bbcd3c07a7051">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5676282008-05-01T07:01:06+03:002008-05-01T07:01:06+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [b348cb278fb1763d10e7d45ebf3a4d5a6f53f0c3] by Yurii Rashkovskii<div><p>
.gitignore added
</p><p>
<a href="http://github.com/yrashk/zoid/commit/b348cb278fb1763d10e7d45ebf3a4d5a6f53f0c3">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5676272008-05-01T07:01:06+03:002008-05-01T07:01:06+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [56dcfd0b9ae91746cf78ea2627b2dbe3b3163186] by Yurii Rashkovskii<div><p>
Some initial specs for routing added (not much :)
</p><p>
<a href="http://github.com/yrashk/zoid/commit/56dcfd0b9ae91746cf78ea2627b2dbe3b3163186">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5675382008-05-01T06:40:44+03:002008-05-01T06:40:44+03:00Yurii Rashkovskii[Changeset] Zoid: Changeset [8ff9e8dd9e58263e19702022752b4c4794a6e560] by Yurii Rashkovskii<div><p>
Some initial files added
</p><p>
<a href="http://github.com/yrashk/zoid/commit/8ff9e8dd9e58263e19702022752b4c4794a6e560">http://github.com/yrashk/zoid/co...</a>
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5655472008-04-30T21:22:00+03:002008-04-30T21:22:00+03:00Yurii Rashkovskii[Page] Zoid: Overview<div><p>
This is a "proposal" overview for Zoid, a minimalistic REST-based webapp framework on top of StrokeDB — i.e. summary of my thoughts about it.
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5643852008-04-30T17:55:37+03:002008-04-30T21:22:00+03:00Yurii Rashkovskii[Page] Zoid: Overview<div><p>
This is a "proposal" overview for Zoid, a minimalistic REST-based webapp framework on top of StrokeDB — i.e. summary of my thoughts about it.
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5643802008-04-30T17:55:11+03:002008-04-30T21:22:00+03:00Yurii Rashkovskii[Page] Zoid: Overview<div><p>
This is a "proposal" overview for Zoid, a minimalistic REST-based webapp framework on top of StrokeDB — i.e. summary of my thoughts about it.
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5643732008-04-30T17:53:12+03:002008-04-30T21:22:00+03:00Yurii Rashkovskii[Page] Zoid: Overview<div><p>
This is a "proposal" overview for Zoid, a minimalistic REST-based webapp framework on top of StrokeDB — i.e. summary of my thoughts about it.
</p></div>tag:strokedb.lighthouseapp.com,2008-04-30:Event/5633212008-04-30T12:19:05+03:002008-04-30T12:19:05+03:00Yurii Rashkovskii[Page] Zoid: Hometag:strokedb.lighthouseapp.com,2008-04-30:Event/5633202008-04-30T12:19:05+03:002008-04-30T12:19:05+03:00Yurii Rashkovskii[Page] Zoid: Home