2

我想在 Rails 应用程序中使用 Disqus gem。我通读了文档,但我不知道如何配置它。似乎是说我们最初需要设置一堆值。我应该如何配置这个 gem?我需要设置初始化程序吗?然后我像这样填充它吗?

Disqus::defaults[:developer]      = false, # allows threads to work on localhost
Disqus::defaults[:container_id]   = 'disqus_thread', # desired thread container
Disqus::defaults[:avatar_size]    = 24, # squared pixel size of avatars
Disqus::defaults[:color]          = 'grey', # theme color

这在我尝试时不起作用。我根本不明白还有什么其他的方法。请帮忙。

4

1 回答 1

2

在 application.rb 添加这些选项:

Disqus::defaults[:account] = 'your_account_name'
Disqus::defaults[:developer] = true # if you want to test it on the localhost

和另一个特殊设置。

在视图中添加行:

<%= raw(disqus_thread) %> # or something different like disqus_count, etc.
于 2011-02-04T12:37:30.720 回答