fixed new co-author relation bug....
This commit is contained in:
1 parent
1289ad9f9d
commit
4f31b1362b
3 files changed
+6
-5
No files matched your search
@@ -14,10 +14,11 @@ class Desktop::CoAuthorRelationsController < ApplicationController
|
||||
|
||||
def create
|
||||
@new_relation = CoAuthorRelation.new(params[:co_author_relation])
|
||||
@co_author_relations = CoAuthorRelation.all
|
||||
|
||||
if @new_relation.save
|
||||
newv = render_to_string :partial=>"show_form", :object=>@new_relation
|
||||
render json: {success:true, msg: "New Relation successfully saved!","newvalue"=>newv}.to_json
|
||||
newv = render_to_string partial: "show_form", object: @co_author_relations
|
||||
render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json
|
||||
else
|
||||
error_msg = @new_relation.errors.full_messages.join("<br />")
|
||||
render json: {success: false, msg: error_msg}.to_json
|
||||
|
||||
Reference in new issue
Block a user