我很惊讶我在谷歌上找不到它,添加“tweet”这个链接以向用户的 Twitter 帐户发布 URL 和描述的最佳方法是什么?
最佳答案
'tweet this link' 功能非常简单,不需要额外的 Rails 功能。它很简单:
<a href=http://twitter.com/home?status=Name_and_Address_of_the_twitter_post_that_you_want_everyone to_see_on_twitter>Add to Twitter</a>
要使用 Rails 代码,它将类似于:
= link_to "tweet me", "http://twitter.com/home?status=#{@post.short_name} #{post_url(@post)}"
一些备注:
关于ruby-on-rails - 在 rails 应用程序中推特此链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3394290/