Ramaze::Controller
Deletes the specified comment. Returns an HTTP 200 response on success, an HTTP 500 response on failure, or an HTTP 404 response if the specified comment does not exist.
id |
comment id |
token |
form token |
{"success":true}
{"error":"The comment could not be deleted due to an unknown database error."}
# File lib/thoth/controller/api/comment.rb, line 54 def delete error_403 unless auth_key_valid? && form_token_valid? error_405 unless request.post? error_404 unless request[:id] && @comment = Comment[request[:id]] response['Content-Type'] = 'application/json' if @comment.destroy action_cache.clear JSON.generate({:success => true}) else respond(JSON.generate({ :error => 'The comment could not be deleted due to an unknown ' << 'database error.' }, 500)) end end
Generated with the Darkfish Rdoc Generator 2.