Hello,
I'm just testing ROAR (& roar-rails) for an rails4 based API and I'm having a small problem trying to implement the DELETE verb.
I'm trying something like this:
DELETE /users/ID/items/ID
def destroy
user = User.find(params[:user_id])
user.items.find(params[:id])
respond_with user
end
But I got this error:
NoMethodError (undefined method `head' for #<API::ItemsController:0x00000006c3b9e0>):
app/controllers/api/litems_controller.rb:23:in `destroy'
Is this the best way to implement a DELETE command?
I'm tempted to do something like:
render json: { status: 'ok' }
TIA