Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 是否向我的rails应用程序添加评论?_Html_Ruby On Rails_Comments - Fatal编程技术网

Html 是否向我的rails应用程序添加评论?

Html 是否向我的rails应用程序添加评论?,html,ruby-on-rails,comments,Html,Ruby On Rails,Comments,我正在尝试在我的rails应用程序中为我的帖子添加评论。但是我不知道在我的show.html.erb模板中插入commontator\u线程(@commontable)。请帮忙。下面是我的show.html.erb代码 <%= link_to pins_path do %> <span class="glyphicon glyphicon-arrow-left"></span> Back <% end %> <div class="r

我正在尝试在我的rails应用程序中为我的帖子添加评论。但是我不知道在我的show.html.erb模板中插入
commontator\u线程(@commontable)
。请帮忙。下面是我的show.html.erb代码

<%= 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>

返回

编辑
  • 评论

可能也想查看gem。它从rails 2开始就存在,是一个可靠的评论系统

不清楚您在问什么。你能解释一下什么是
commontator\u线程(@commontable)
以及它来自哪里吗?也许会发布一些来自控制器的代码?请查看我的答案,@KirtiThorat也对这个问题做出了回应