CRUDtree
Summary
A resource helper mainly for usher, but may be adapted for other routers as well.
See
- Usher
- IRC
- Baretest
Terminology
- Master
-
The main body, only one per Usher instance as well.
- Node
-
You attach other Nodes or EndNodes as subnodes here.
- EndNode
-
A route endpoint.
Usage
as Tinkerer
require 'crudtree/interface/usher/rack'
Usher::Interface.for(:rack) do
extend CRUDtree::Interface::Usher::Rack
node(klass: Posts) do
sub(type: :member, call: :show, rest: :get)
sub(type: :collection, call: :index, rest: :get)
end
end
As Dev
require 'crudtree/interface/usher/rack'
require 'crudtree/helper'
Usher::Interface.for(:rack) do
extend CRUDtree::Interface::Usher::Rack
extend CRUDtree::Interface::Helper
resource(klass: Posts) do # the resource helper will include a bunch of default routes
member(call: :show, rest: :get)
collection(call: :index, rest: :get)
end
end