ROR 博客示例应用程序中缺少“添加评论”选项
ROR 示例应用程序 URL - http://sixrevisions.com/web-development/how-to-create-a-blog-from-scratch-using-ruby-on-rails/
我尝试了上面的参考来使用 Ruby 创建博客应用程序在导轨。 除了帖子显示页面中的“添加评论”选项外,一切正常。
根据参考 URL,“添加评论”将出现在显示页面本身中。但在我的本地浏览器中我看不到它。
注意:我使用 Rails 3.1.3 和 PostgreSQL 9.0.5 后端
ROR Sample Application URL - http://sixrevisions.com/web-development/how-to-create-a-blog-from-scratch-using-ruby-on-rails/
I tried above reference for creating a blog application using Ruby on Rails.
Everything is working fine except the option "Add Comment" in show page of a Post.
As per the reference URL "Add Comment" will be there in Show page itself. But in my local browser I am not able to see it.
Note : I am using Rails 3.1.3 with back end of PostgreSQL 9.0.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
本教程基于 RoR 2。您使用的是 Rails 3.1.3,这意味着本教程不起作用。
根据建议,我会使用官方指南: http://guides.rubyonrails.org/getting_started.html< /a>
This tutorial is based on RoR 2. You are using Rails 3.1.3, which means that this tutorial won't work.
As suggested, I would go with the official guide : http://guides.rubyonrails.org/getting_started.html
您可能错过了代码中的某些内容(显然,我知道),我建议回滚到没有注释的工作模型,并遵循那里的指南。
本指南是示例博客指南的副本,位于 http://guides.rubyonrails.org/getting_started.html 所以我建议遵循官方指南,因为它可能会更详细地解释并涵盖基于社区反馈的主题。我发现这些指南是网络上最新的 Rails 资源。
You have probably missed something in the code (obvious, I know), I would suggest rolling back to a working model without comments and following the guide from there.
This guide is a copy of the sample blog guide found at http://guides.rubyonrails.org/getting_started.html so I would suggest following the official guide as it probably explains in more detail and covers topics based on community feedback. I have found these guides to be the most up-to-date resource for rails on the web.
Rails 3.0 改变了 ERB 标签 (
<%
) 的解释方式。您现在需要对任何捕获输出的块使用<%=
。如果您在 3.0.x 中运行此程序,您会看到弃用警告,但 3.1.x 假定您已经进行了更改并默默地失败。会变成:
Rails 3.0 changed how ERB tags (
<%
) are interpreted. You now need to use<%=
with any blocks that are capturing output. If you were running this in 3.0.x, you would see deprecation warnings, but 3.1.x assumes you have already made the changes and silently fails.would become: