评论系统不会显示,我在视图中看到的是:
<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>
我哪里错了?谢谢
解决方法 我认为你需要使用raw或HTML_safe.= raw disqus_thread
要么
= disqus_thread.HTML_safe总结
以上是内存溢出为你收集整理的ruby-on-rails – Rails 3:添加DISQUS gem以供评论全部内容,希望文章能够帮你解决ruby-on-rails – Rails 3:添加DISQUS gem以供评论所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)