Ensure that 404 errors are thrown for inexistent annotations

This commit is contained in:
kikito
2015-12-16 18:07:03 +01:00
parent 22ec287b16
commit 6335732ce6

View File

@@ -11,14 +11,14 @@ class AnnotationsController < ApplicationController
end
def update
@annotation = Annotation.find(params[:id])
@annotation = Annotation.find!(params[:id])
if @annotation.update_attributes(annotation_params)
render json: @annotation.to_json
end
end
def destroy
@annotation = Annotation.find(params[:id])
@annotation = Annotation.find!(params[:id])
@annotation.destroy
render json: { status: :ok }
end