Twitter in ruby on rails helper
I want to include my tweets on my homepage. Currently I have a helper which looks like this:
module WelcomesHelper
def recent_tweets(user)
html = "<div>"
Twitter.user_timeline(user).each do |tweet|
html << '<span class="tweet">' << tweet.text << '</span>'
end
html << "</div>"
end
end
However, it can not find the twitter gem. If it require it from irb it works fine, but how do I include it开发者_运维技巧 in my rails app?
Assuming rails3 - add
gem 'Twitter'
to your Gemfile, run bundle and it should work in your application.
精彩评论