kales / kales / KalesApplication / createCustomRequestMethodViaFormParamHandler

createCustomRequestMethodViaFormParamHandler

fun <T : ApplicationController> createCustomRequestMethodViaFormParamHandler(controllerClass: KClass<T>, path: String, actionName: String, method: String): Unit

Install a catch-all route that captures POST requests to any path and looks for a _method form parameter. If one is found, we then look for a DELETE/PATCH/PUT handler that matches that and rout to that handler instead. This is to work around a limitation where browsers don't support those verbs (only GET and POST) and it's the same workaround that Rails uses.