diff --git a/app/controllers/desktop/co_authors_controller.rb b/app/controllers/desktop/co_authors_controller.rb index 2ea928bc..d41e2348 100644 --- a/app/controllers/desktop/co_authors_controller.rb +++ b/app/controllers/desktop/co_authors_controller.rb @@ -39,7 +39,8 @@ class Desktop::CoAuthorsController < ApplicationController if @co_author.save render json: {success:true, msg: "Co-author successfully saved!"}.to_json else - render json: {success: false, msg: @co_author.errors.full_messages}.to_json + error_msg = @co_author.errors.full_messages.join("
") + render json: {success: false, msg: error_msg}.to_json end end @@ -49,7 +50,8 @@ class Desktop::CoAuthorsController < ApplicationController if @co_author.update_attributes(params[:co_author]) render json: {success:true, msg: "Co-author successfully update!"}.to_json else - render json: {success: false, msg: @co_author.errors.full_messages}.to_json + error_msg = @co_author.errors.full_messages.join("
") + render json: {success: false, msg: error_msg}.to_json end end diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 66c613ef..69334a5b 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -23,7 +23,6 @@ class Desktop::JournalPagesController < ApplicationController @journal_candidate = WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq - respond_to do |format| format.html { render :layout => false} end @@ -47,7 +46,8 @@ class Desktop::JournalPagesController < ApplicationController 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 + error_msg = @writing_journal.errors.full_messages.join("
") + render json: {success: false, msg: error_msg}.to_json end end @@ -58,7 +58,8 @@ 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: @writing_journal.errors.full_messages}.to_json + error_msg = @writing_journal.errors.full_messages.join("
") + render json: {success: false, msg: error_msg}.to_json end end end @@ -66,19 +67,6 @@ class Desktop::JournalPagesController < ApplicationController def check_file_type file if not file.nil? file_type = MIME::Types.type_for(file).first.to_s.split("/")[1] - - # case file_type - # when "jpg", "jpeg" - # type = "jpg" - # when "text", "txt" - # type = "txt" - # when "pdf" - # type = "pdf" - # when "png" - # type = "png" - # else "readme" - # end - file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png" else file_type = "" diff --git a/app/views/desktop/journal_pages/_form.html.erb b/app/views/desktop/journal_pages/_form.html.erb index b2328dc4..5f88322e 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -1,8 +1,8 @@
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %> - + + <%= submit_tag "Cancel", :type => "button", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
Entry Year