Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Ruby library for the Disqus commenting API and Javascript widgets.
Tree: c6fc52e5bf

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Disqus Ruby Gem

The Disqus Gem helps you easily integrate the Disqus commenting system into your website. It works for any site programmed in Ruby, and has view helpers for Rails and Merb.

Support for the Disqus Javascript widgets is stable. Disqus API support is “beta.”

What is Disqus?

From the Disqus website:

“Disqus, pronounced ”discuss“, is a service and tool for web comments and discussions. The Disqus comment system can be plugged into any website, blog, or application. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community.”

“Disqus is a free service to the general public with absolutely no inline advertisements.”

Get it

Stable release (does not yet include API):

gem install disqus

Bleeding Edge (includes API):

gem install norman-disqus  --source

Use it:

Configure it:

Generic example:
Disqus::defaults[:account] = "my_disqus_account"
# Optional, only if you're using the API
Disqus::defaults[:api_key] = "my_disqus_api_key"
Rails-specific example:
# in config/development.rb (or production.rb, test.rb, etc.)
config.after_initialize do
  Disqus::defaults[:account] = "my_disqus_account"
  # Optional, only if you're using the API
  Disqus::defaults[:api_key] = "my_disqus_api_key"

Note that here the “after initialize” is necessary, otherwise your settings won't be set properly.

Show the comment threads widget on a post page:

# Loads the commenting system

# Or if you're not using Rails/Merb:

# Sets the inner html to the comment count for any links on the page that
# have the anchor "disqus_thread". For example, "View Comments" below would
# be replaced by "1 comment" or "23 comments" etc.
# <a href="">View Comments</a>
# <a href="">View Comments</a>

# Or if you're not using Rails/Merb:

Show the combo widget on a post page:

disqus_combo(:color => "blue", :hide_mods => false, :num_items => 20)

# Or for non-Rails/Merb:
Disqus::Widget::combo(:color => "blue", :hide_mods => false, :num_items => 20)

Show the comment count on a permalink:

link_to("Permalink", post_path(@post, :anchor => "disqus_thread"))

# Or for non-Rails/Merb:

Work with the Disqus API:

See the Disqus::Api class for more info on the Disqus API. You can also read the Disqus developer info here.

Hack it:

Github repository:

Submit bug reports:

Please use our Lighthouse.

Learn more about Disqus:

Thanks to the following contributors:

Legal Stuff

The Disqus Ruby gem was not created by, nor is officially supported by or Big Head Labs, Inc. Use it at your own risk and your own responsibility under the terms of the MIT License.

Copyright © 2008 Norman Clarke, released under the MIT license

Something went wrong with that request. Please try again.