fixed journal update method

This commit is contained in:
Rueshyna authored and chris committed 2012-12-04 00:31:06 +08:00
1 parent ee830f148e
commit 7f7b33f310
3 files changed
+8 -10

No files matched your search

@@ -54,15 +54,13 @@ class Desktop::JournalPagesController < ApplicationController
def update
params[:writing_journal][:update_user_id] = current_user.id
@writing_journal= WritingJournal.find(params[:id])
# @writing_journal.update_user_id = current_user.id
if @writing_journal.update_attributes(params[:writing_journal])
render json: {success: true, msg: t('update.success.paper')}.to_json
else
error_msg = @writing_journal.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
if @writing_journal.update_attributes(params[:writing_journal])
render json: {success: true, msg: t('update.success.paper')}.to_json
else
error_msg = @writing_journal.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def check_file_type file