详情页面留言为空的问题

This commit is contained in:
huang 2016-06-08 10:02:10 +08:00
parent 67f0cad331
commit 49406681ef
1 changed files with 6 additions and 1 deletions

View File

@ -96,7 +96,12 @@ class OrgDocumentCommentsController < ApplicationController
def add_reply_in_doc
@document = OrgDocumentComment.find(params[:id]).root
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
if params[:org_comment].blank?
@comment.content = params[:org_content]
else
@comment.content = params[:org_comment][:org_content]
end
@document.children << @comment
@document.save
respond_to do |format|