fixed add journal and co-author curd problem, but have redirect problem...
This commit is contained in:
1 parent
bb69a059e8
commit
9e400e6e6a
7 files changed
+20
-45
No files matched your search
@@ -1,4 +1,5 @@
|
||||
class Desktop::JournalPagesController < ApplicationController
|
||||
#before_filter :check_for_cancel, :only => [:create, :update]
|
||||
|
||||
def index
|
||||
@writing_journal = WritingJournal.where(create_user_id: current_user.id)
|
||||
@@ -35,14 +36,14 @@ class Desktop::JournalPagesController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
params[:writing_journal][:create_user_id] = current_user.id
|
||||
@writing_journal = WritingJournal.new(params[:writing_journal])
|
||||
params[:writing_journal][:create_user_id] = current_user.id
|
||||
@writing_journal = WritingJournal.new(params[:writing_journal])
|
||||
|
||||
if @writing_journal.save
|
||||
render json: {success: true, msg: "Paper successfully saved!"}.to_json
|
||||
else
|
||||
render json: {success: false, msg: "Saving failed!"}.to_json
|
||||
end
|
||||
if @writing_journal.save
|
||||
render json: {success: true, msg: "Paper successfully saved!"}.to_json
|
||||
else
|
||||
render json: {success: false, msg: @writing_journal.errors.full_messages}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -52,7 +53,7 @@ class Desktop::JournalPagesController < ApplicationController
|
||||
if @writing_journal.update_attributes(params[:writing_journal])
|
||||
render json: {success: true, msg: "Paper successfully saved!"}.to_json
|
||||
else
|
||||
render json: {success: false, msg: "Saving failed!"}.to_json
|
||||
render json: {success: false, msg: @writing_journal.errors.full_messages}.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user