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
Coming from rails I have learned to prefer PATCH over PUT. lucky already supports this somewhat:
You can use the patch route helper in your actions.
The link helper will generate the correct data-method attribute.
Rails-UJS takes care of sending a POST request with the _method parameter.
When the request arrives in lucky, it will not work, though. PATCH is currently not allowed as a method override and thus POST will be assumed for this request. The relevant code is here:
Coming from rails I have learned to prefer PATCH over PUT. lucky already supports this somewhat:
patch
route helper in your actions.link
helper will generate the correctdata-method
attribute._method
parameter.When the request arrives in lucky, it will not work, though. PATCH is currently not allowed as a method override and thus POST will be assumed for this request. The relevant code is here:
lucky/src/lucky/http_method_override_handler.cr
Line 15 in b69d163
In my case this failed more or less silently. I suspect that if there is a matching route with POST even more confusing things could happen.
I would like to see PATCH fully supported just like PUT and DELETE. In fact I already prepared a PR I am happy to send, if you agree.
But I also understand if you want to keep the list of supported HTTP method overrides to a minimum.
The text was updated successfully, but these errors were encountered: