Created
September 4, 2013 09:36
-
-
Save Nosfheratu/6434822 to your computer and use it in GitHub Desktop.
Disqus up and running on Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#disqus_thread | |
:javascript | |
// put the short name you signed up with here | |
var disqus_shortname = 'example'; | |
var disqus_developer = #{ Rails.env == "production" ? '0' : '1' }; | |
var disqus_title = "#{ title }"; | |
var disqus_url = "#{ request.url }"; | |
var disqus_identifier = "#{ request.fullpath }"; | |
(function() { | |
var dsq = document.createElement('script'); | |
dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= render partial: 'shared/disqus', locals: { title: @post.title } %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment