Merge branch 'make_jsFunc_for_journalP' of github.com:Rulingcom/orbit into make_jsFunc_for_journalP

This commit is contained in:
chris committed 2012-11-26 05:02:58 +08:00
commit 1e89c30150
5 files changed
+66 -21

No files matched your search

@@ -57,9 +57,23 @@ 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 }
#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
@co_authors = CoAuthor.where(name_id: current_user.id)
data = Array.new
@co_authors.each do |co_author|
data << {
author: co_author.co_author,
email: co_author.email,
type: co_author.type
}
end
render json: JSON.pretty_generate(data)
end
end
@@ -80,6 +80,12 @@ class Desktop::JournalPagesController < ApplicationController
end
end
def destroy
@writing_journal = WritingJournal.find(params[:id])
@writing_journal.destroy
render :json => {success: true,msg: "Paper deleted successfully!"}
end
def get_journals_json
publications = WritingJournal.where(create_user_id: current_user.id)