【发布时间】:2014-08-08 21:25:57
【问题描述】:
我正在http://www.reinteractive.net/posts/32-ruby-on-rails-3-2-blog-in-15-minutes-step-by-step 的帮助下创建一个博客。添加新的博客文章非常棒,但每次我想发表新评论时都会收到以下错误:
<h2>Comments</h2>
<div id="comments">
<%= render :partial => @post.comments %>
</div>
<%= form_for [@post, Comment.new] do |f| %>
我得到的错误:
ActionView::MissingTemplate in Posts#show
Missing partial comments/_comment with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in:
* "/Users/Reuzellf/quick_blog/app/views"
Ruby 对我来说是全新的,我真的不知道如何解决这个问题。
【问题讨论】:
-
我没有看到任何错误。
-
对不起,我很快就发布了
-
似乎有问题: @post.cmets %>
-
您是否在您附加的
link中看到了这一行You'll now need to create a file called app/views/comments/_comment.html.erb with the following contents?
标签: ruby-on-rails ruby actionview