2014-06-10 62 views
-1

即時通訊嘗試添加評論到我的文章在我的Rails應用程序。但我不知道在哪裏插入commontator_thread(@commontable)到我的show.html.erb模板中。請幫忙。下面是我的代碼爲show.html.erb。添加評論到我的rails應用程序?

<%= link_to pins_path do %> 
    <span class="glyphicon glyphicon-arrow-left"></span> Back 
<% end %> 

<div class="row"> 
    <div class="col-md-offset-2 col-md-8"> 
    <div class="panel panel-default"> 
    <div class="panel-heading center"> 
      <%= image_tag @pin.image.url(:medium), class: "img-rounded img-polaroid" %> 
     </div> 
     <div class="panel"> 
     <p><%= @pin.description %></p> 
     <p><strong><%= @pin.user.name if @pin.user %></strong></p> 

     <% if @pin.user == current_user %> 
     <%= link_to edit_pin_path(@pin) do %> 
     <span class="glyphicon glyphicon-edit"></span> Edit 

     <ul class="media-list"> 
    <li class="media"> 
    <a class="pull-left" href="#"> 
     <img class="media-object" src="..." alt="..."> 
    </a> 
    <div class="media-body"> 
     <h4 class="media-heading">Comments</h4> 

    </div> 
    </li> 
</ul> 

    <% end %> 
     <% end %> 
     </div> 
    </div> 
</div> 
+2

目前還不清楚你在問什麼。你能解釋一下'commontator_thread(@commontable)'是什麼以及它來自哪裏?也許從控制器發佈一些代碼? – Stratus3D

+0

查看我的答案[鏈接](http://stackoverflow.com/questions/20459291/adding-comments-with-gem-ruby-on-rails/25027492#25027492)還@ @ KirtiThorat也迴應了這個問題[鏈接](http://stackoverflow.com/questions/22342512/undefined-local-variable-or-method-error-when-using-commontator-gem-for-commen) – Cyzanfar

回答

相關問題