From eb8f601e31ef71e2b442a2b9122317d64118ec42 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 21 Feb 2013 11:47:54 -0500 Subject: [PATCH] fix bugs with note deletion --- app/assets/javascripts/notes.js | 4 ++++ app/controllers/notes_controller.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8d004512d..365c95f5d 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -380,6 +380,10 @@ Danbooru.Note = { }, delete: function() { + if (!confirm("Do you really want to delete this note?")) { + return + } + var $this = $(this); var id = $this.data("id"); Danbooru.Note.Box.find(id).remove(); diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 96b5abac3..995c66d48 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -36,7 +36,7 @@ class NotesController < ApplicationController def destroy @note = Note.find(params[:id]) - @note.update_column(:is_active, false) + @note.update_attribute(:is_active, false) respond_with(@note) end