Friday, October 07, 2011

Integrating Tweet Button in Rails App

In Rails 3.0 app:

1) In Gemfile include:

gem 'tweet-button'

2) bundle install

3) In application_helper.rb include:

module ApplicationHelper
include TweetButton

... other methods...
end

4) In your partial:

<%= tweet_button(:via => "CreditCardLogic", :url => polymorphic_url(article), :text => "Check this out!") %>

To see this in action, check out my credit cards site.