开发者

Rails 3: adding DISQUS gem for comments

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 developmen开发者_开发技巧t 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


I think you need to use raw or html_safe.

 = raw disqus_thread

or

 = disqus_thread.html_safe
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜