Rails 3:添加 DISQUS gem 进行评论
您好,我正在尝试在 Rails 3 应用程序中获取 DISCUS 评论。似乎没有很好的设置指南。
评论系统不会显示,我在视图中看到的只是这样:
<script type="text/javascript">var disqus_developer = 1;</script><div id="disqus_thread"></div>
<script type="text/javascript" src="http://disqus.com/forums/gppublic/embed.js"></script>
<noscript><a href="http://gppublic.disqus.com/?url=ref">View the discussion thread</a></noscript>
这是我设置它的步骤:
1)gem install disqus
2)将配置块放在 application.rb 中并添加您的具体帐户名称
config.after_initialize do
Disqus::defaults[:account] = "youraccountname"
# so that the comments will load up in development environment
Disqus::defaults[:developer] = true
Disqus::defaults[:container_id] = "disqus_thread"
Disqus::defaults[:show_powered_by] = false
end
3) 然后将其放入我的显示视图中
<div id ="disqus_thread">
<%= disqus_thread %>
</div>
我哪里出错了?谢谢
Hi I'm trying to get DISCUS comments working in a Rails 3 app.There doesn't seem to be a good guide for setting this up.
The comment system won't show up and all I get in the view is this :
<script type="text/javascript">var disqus_developer = 1;</script><div id="disqus_thread"></div>
<script type="text/javascript" src="http://disqus.com/forums/gppublic/embed.js"></script>
<noscript><a href="http://gppublic.disqus.com/?url=ref">View the discussion thread</a></noscript>
Here's the step I took to set it up:
1) gem install disqus
2) place the config block in application.rb and add your specific account name
config.after_initialize do
Disqus::defaults[:account] = "youraccountname"
# so that the comments will load up in development environment
Disqus::defaults[:developer] = true
Disqus::defaults[:container_id] = "disqus_thread"
Disqus::defaults[:show_powered_by] = false
end
3) then place in my show view
<div id ="disqus_thread">
<%= disqus_thread %>
</div>
Where am I going wrong? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你需要使用 raw 或 html_safe。
或者
I think you need to use raw or html_safe.
or