I 'Tweet' this
Jeroen Bulters ma 16 aug 10
Although I have a deep-rooted and sincere hatred towards Facebook ‘like’ buttons, I do like “Tweet this” buttons. I just prefer twitter over facebook (at least untill farmville introduces twitter integration).
The guys at Intridea were thinking the same and created a gem to make it easy to incorporate Twitter’s own Tweet buttons into your Rails applications.
Setup is as straightforward as can be. Install the tweet-button gem, include the TweetButton module in your ApplicationHelper (or any other for finer-grained accessibility) and you’re all set.
The only thing left to do is put the button right where you want it.
<%= tweet_button :text => "Pure awesomeness!", :via => "bulters" -%>
Clicking the resulting button will open up a popup which will allow you to tweet the text, followed by the url of the page (which, in turn, will be shortened automatically by Twitter’s future t.co service) and the associated user.
Of course, it is possible to set some preferences globally. This is done by setting the default_tweet_button_options variable of the TweetButton module. For example:
TweetButton.default_tweet_button_options = {:via => "bulters" }
Incorporating tweet button’s can’t get any easier than this.
Gepost in hor | 0 reacties
Welcome to Holland On Rails
This weblog is the official Ruby techblog from the guys at Holder, a Ruby development company. Holder is also the company behind the RubyAndRails Europe Conference in Amsterdam.Recente Jobs
Bekijk alle jobs »»
Gereedschapskist
Onmisbare tools vooriedere developer!
- Ruby On Rails
Framework voor de web 2.0 developer. Eindelijk vooruitgang! - TextMate
Editor for true pro's
Typ, tab, top :-)
Nee, niet voor Win. - Made On A Mac
En nou is het over met die saaie grijze Windows bak van je!
Auteurs op deze site
Chris Obdam
'Less is more' evangelist, past dit ook dagelijks toe op zijn tandenborstel.Chiel Wester
Snelheidswonder op Ruby wielen. Leuk om mee te pair-programmen ;-)
Plaats je reactie