Ruby on Rails Pinterest按钮媒体图像

时间:2012-06-26 13:01:02

标签: ruby-on-rails ruby haml pinterest

我有一个在rails和haml上使用ruby的博客 我将pinterest按钮添加到模板中,以便它出现在每个帖子中。现在我希望博客文章的预览图像自动插入媒体参数中。 我只是无法弄清楚如何获取预览图像或(如果这不可能使用rails / haml)将在pinterest弹出窗口中显示的帖子的第一个图像。谢谢你的帮助!

%a.pinterest-share-button{:title => "Pin It", 
                          :class => "pin-it-button", 
                          :href => "http://pinterest.com/pin/create/button/?url=#{request.url}&media{CODE HERE}&description=#{@post.title}", 
                          :rel => "nofollow", 
                          :target => "_blank", 
                          "count-layout" => "horizontal"} 
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />

0 个答案:

没有答案