Hi,
I have a problem handling DELETE method in REST controller using following element URI:
DELETE /resources/[ID]
REST controller tries to call a delete_[ID] method, which can't be handled. Shouldn't it call delete_index([ID])? Or maybe I'm doing something wrong?
Thanks for any help!
where $resource is a parameter passed to the router method which contains the first URI segment (unless you have routing in place that messes with the URI).
Resources is my REST controller, so the second URI will call delete_resource([ID]) method. However, wouldn't it be more convenient to call delete_index([ID]) when given the first URI? Calling delete_[ID] is useless.
How would the Rest controller know that the second URI is an ID and not an action name?
If you want that, create a route for it that routes /resources/[ID] to /resources/index/[ID].