From 8009c6aa3450ee065dc0de488d14fbde225e1383 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Fri, 23 Nov 2012 12:28:36 +0800 Subject: [PATCH] fixed delete function --- app/controllers/desktop/co_authors_controller.rb | 8 ++++---- app/controllers/desktop/journal_pages_controller.rb | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/desktop/co_authors_controller.rb b/app/controllers/desktop/co_authors_controller.rb index ccda3786..2ea928bc 100644 --- a/app/controllers/desktop/co_authors_controller.rb +++ b/app/controllers/desktop/co_authors_controller.rb @@ -57,10 +57,10 @@ class Desktop::CoAuthorsController < ApplicationController @co_author = CoAuthor.find(params[:id]) @co_author.destroy - respond_to do |format| - format.html { redirect_to desktop_co_authors_url, :layout => false } - format.json { head :no_content } - end + #respond_to do |format| + # format.html { redirect_to desktop_co_authors_url, :layout => false } + # format.json { head :no_content } + #end end def get_co_authors_json diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 6aa8c7fd..dfd37471 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -80,6 +80,11 @@ class Desktop::JournalPagesController < ApplicationController end end + def destroy + @writing_journal = WritingJournal.find(params[:id]) + @writing_journal.destroy + end + def get_journals_json publications = WritingJournal.where(create_user_id: current_user.id)