Route to the action
(controllerRoute, actionName string)
| 215 | |
| 216 | // Route to the action |
| 217 | func (l *loader) loadActionRoute(controllerRoute, actionName string) string { |
| 218 | switch actionName { |
| 219 | case "Show", "Update", "Delete": |
| 220 | return path.Join(controllerRoute, ":id") |
| 221 | case "New": |
| 222 | return path.Join(controllerRoute, "new") |
| 223 | case "Edit": |
| 224 | return path.Join(controllerRoute, ":id", "edit") |
| 225 | case "Index", "Create": |
| 226 | return controllerRoute |
| 227 | default: |
| 228 | return path.Join(controllerRoute, text.Lower(text.Snake(actionName))) |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | const ( |
| 233 | methodGet = "Get" |