You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
startFormTag() throws RouteNotFound for PUT/PATCH/DELETE member routes #3517
startFormTag(route="customer", method="delete") throws Wheels.RouteNotFound: Could not find a 'customer' route that matched the supplied arguments. for any resource member route (GET/PATCH/PUT/DELETE), because startFormTag() resolves the named route with the rewritten HTML verb post instead of the original verb.
Repro
With resources(name="customers") configured, rendering a delete/update form:
view/forms.cfc:$startFormTagMethod() rewrites method from put/patch/delete to post (for the rendered <form method>), remembering the original verb only for the _method hidden field. startFormTag() then calls urlFor(argumentCollection=arguments) (and later $routeVariables(argumentCollection=arguments)) with arguments.method = "post".
The new $findRoute() disambiguation in global/routing.cfm throws when a method matches none of a same-named route's candidates. Resource member routes carry get/patch/put/delete — never post — so the lookup throws. The previous $findRoute() masked this by silently falling through to the last same-named route.
Suggested fix
Resolve the route with the ORIGINAL verb, then restore the HTML form verb before rendering:
Activity