diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index c8cc29b63..db288306d 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -96,10 +96,13 @@ class SubDocumentCommentsController < ApplicationController end def add_reply - @document = OrgDocumentComment.find(params[:id]).root + @document = SubDocumentComment.find(params[:id]).root + @subdomain = @document.sub_domain + @org_subfield = @subdomain.org_subfield + @organization = @org_subfield.organization @act = OrgActivity.find(params[:id]) - @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) - @comment.content = params[:org_content] + @comment = SubDocumentComment.new(:sub_domain_id => @document.sub_domain, :creator_id => User.current.id, :reply_id => params[:id]) + @comment.content = params[:sub_content] @document.children << @comment @document.save end diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index 219a05194..0b8264d33 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -7,7 +7,7 @@ <% @documents.each do |document| %> <%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %> diff --git a/app/views/sub_document_comments/_show_sub_document.html.erb b/app/views/sub_document_comments/_show_sub_document.html.erb index 0e5c9a2b0..b500f69a4 100644 --- a/app/views/sub_document_comments/_show_sub_document.html.erb +++ b/app/views/sub_document_comments/_show_sub_document.html.erb @@ -9,7 +9,7 @@ <%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> TO <%= link_to document.sub_domain.name, organization_path(@organization), :class => "newsBlue" %> | - <%=link_to document.sub_domain.name, org_subfield_sub_domain_sub_document_comment_path(document,:org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id), :class => "newsBlue" %> + <%=link_to document.sub_domain.name, org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id), :class => "newsBlue" %> <%# if document.organization.home_id == document.id %> <%# end %> @@ -18,7 +18,7 @@