From 900f11fd49b3eedc1ca94eed564a953a9d3bc794 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 16 Dec 2015 18:44:55 +0100 Subject: [PATCH] ActiveRecord.find already throws a 404 if not existing; there is no find! --- app/controllers/annotations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/annotations_controller.rb b/app/controllers/annotations_controller.rb index 233275bdf..d70a2e9be 100644 --- a/app/controllers/annotations_controller.rb +++ b/app/controllers/annotations_controller.rb @@ -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