From aa4d71d879c2a222ec7dc7a1e3aa51d855fe30f5 Mon Sep 17 00:00:00 2001 From: vikin <986465329@qq.com> Date: Fri, 21 Oct 2016 00:06:53 +0800 Subject: [PATCH] Resource table finished --- routing/controller | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/routing/controller b/routing/controller index e1a8393e..6abc2dd9 100644 --- a/routing/controller +++ b/routing/controller @@ -47,7 +47,28 @@ This single route declaration creates multiple routes to handle a variety of act The generated controller will already have methods stubbed for each of these actions, including notes informing you of the HTTP verbs and URIs they handle. -| Verb | URI | Action| -| ------------- |:-------------:| -----:| +| Verb | URI | Action | +| :-------------: | :-------------: | :-----------: | +| GET | test/index | test.index | +| POST | test/create | test.create | +| GET | test/show | test.show | +| PUT | test/replace | test.replace | +| PATCH | test/destroy | test.destroy | +| DELETE | test/destroy | test.destroy | +| DELETE | test/clear | test.clear | +You can also custom method name, add `makeResource` method in the controller +```swift + func makeResource() -> Resource { + return Resource( + index: index, + store: create, + show: show, + replace: replace, + modify: update, + destroy: delete, + clear: clear + ) + } +```