ActiveRecord.find already throws a 404 if not existing; there is no find!

This commit is contained in:
kikito
2015-12-16 18:44:55 +01:00
parent 60e78e58fa
commit 900f11fd49

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(methods: :permissions)
end
end
def destroy
@annotation = Annotation.find!(params[:id])
@annotation = Annotation.find(params[:id])
@annotation.destroy
render json: { status: :ok }
end