Search code examples
ruby-on-railsruby-on-rails-3oauthdevisefacebook-comments

How to integrate facebook comments in Rails application?


I've set up a Rails 3.2 application with Devise. I was wondering how I can allow users to comment using Facebook. Can I use facebook connect along with Devise? If I can, is it ok to have 2 methods of authentication on my site?

I've read some tutorials on setting up OAuth with Devise to allow facebook connect, but it's not all that clear to me. Does anyone know a good step-by-step tutorial on how to integrate facebook comments with Devise already set up? Thanks a lot!


Solution

  • You don't need to setup Facebook Connect for comments.

    You have to first create a Facebook app, then generate the comments plugin. After, put the Javascript code in your application.html.erb after the body tag (my suggestion is to make a partial). In the end, drop the div with the fb-comments class where you want the comments box to appear.