fixed delete function

This commit is contained in:
Rueshyna 2012-11-23 12:28:36 +08:00
parent e06495d4ad
commit 8009c6aa34
2 changed files with 9 additions and 4 deletions

View File

@ -57,10 +57,10 @@ class Desktop::CoAuthorsController < ApplicationController
@co_author = CoAuthor.find(params[:id]) @co_author = CoAuthor.find(params[:id])
@co_author.destroy @co_author.destroy
respond_to do |format| #respond_to do |format|
format.html { redirect_to desktop_co_authors_url, :layout => false } # format.html { redirect_to desktop_co_authors_url, :layout => false }
format.json { head :no_content } # format.json { head :no_content }
end #end
end end
def get_co_authors_json def get_co_authors_json

View File

@ -80,6 +80,11 @@ class Desktop::JournalPagesController < ApplicationController
end end
end end
def destroy
@writing_journal = WritingJournal.find(params[:id])
@writing_journal.destroy
end
def get_journals_json def get_journals_json
publications = WritingJournal.where(create_user_id: current_user.id) publications = WritingJournal.where(create_user_id: current_user.id)