modified error msgs and cancle button, but those two have bug...
This commit is contained in:
1 parent
613bbec1f0
commit
0125010a05
3 files changed
+10
-20
No files matched your search
@@ -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("<br />")
|
||||
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("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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("<br />")
|
||||
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("<br />")
|
||||
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 = ""
|
||||
|
||||
Reference in new issue
Block a user