From 7f7b33f31058991697a244dae23302c044bb42d3 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Thu, 29 Nov 2012 16:48:07 +0800 Subject: [PATCH] fixed journal update method --- .../desktop/journal_pages_controller.rb | 14 ++++++-------- app/views/desktop/journal_p.html.erb | 2 +- app/views/devise/registrations/edit.html.erb | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index cadd7f8e..5775be0a 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -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("
") - 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("
") + render json: {success: false, msg: error_msg}.to_json + end end def check_file_type file diff --git a/app/views/desktop/journal_p.html.erb b/app/views/desktop/journal_p.html.erb index b27c3560..e6b455a0 100644 --- a/app/views/desktop/journal_p.html.erb +++ b/app/views/desktop/journal_p.html.erb @@ -16,7 +16,7 @@
  • List
  • Add/Edit
  • Journals
  • -
  • Co-Authors
  • +
  • Co-Authors
  • Tags & Keywords
  • Analysis
  • Import
  • diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 5f272075..4d74f8d8 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -23,4 +23,4 @@

    Unhappy? <%#= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.

    <%#= link_to "Back", :back %> - --> \ No newline at end of file + -->