Resource table finished

This commit is contained in:
vikin 2016-10-21 00:06:53 +08:00 committed by GitHub
parent 739cb89630
commit aa4d71d879
1 changed files with 23 additions and 2 deletions

View File

@ -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<First> {
return Resource(
index: index,
store: create,
show: show,
replace: replace,
modify: update,
destroy: delete,
clear: clear
)
}
```