ActiveRecord.find already throws a 404 if not existing; there is no find!
This commit is contained in:
@@ -11,14 +11,14 @@ class AnnotationsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@annotation = Annotation.find!(params[:id])
|
@annotation = Annotation.find(params[:id])
|
||||||
if @annotation.update_attributes(annotation_params)
|
if @annotation.update_attributes(annotation_params)
|
||||||
render json: @annotation.to_json(methods: :permissions)
|
render json: @annotation.to_json(methods: :permissions)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@annotation = Annotation.find!(params[:id])
|
@annotation = Annotation.find(params[:id])
|
||||||
@annotation.destroy
|
@annotation.destroy
|
||||||
render json: { status: :ok }
|
render json: { status: :ok }
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user