Created
September 26, 2010 18:06
-
-
Save matiaskorhonen/598157 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function() { | |
$("iframe[data-url^='http']").attr("src", function() { return $(this).attr("data-url") }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
# Facebook Like button | |
def like_button_tag(url) | |
content_tag :iframe, nil, { :'data-url' => "http://www.facebook.com/plugins/like.php?href=#{URI::escape(url)}&layout=standard&show_faces=false&width=400&action=like&colorscheme=light&height=35", | |
:scrolling => "no", | |
:frameborder => "0", | |
:style => "border:none; overflow:hidden; width:400px; height:35px;", | |
:allowTransparency => "true" } | |
end | |
# Tweet button | |
def tweet_button_tag(options = {}) | |
src = "http://platform.twitter.com/widgets/tweet_button.html?via=YOUR_TWITTER_ACCOUNT&count=horizontal" | |
src << "&text=#{URI::escape(options[:tweet_text])}" if options[:tweet_text] | |
content_tag :iframe, nil, { :'data-url' => src, | |
:scrolling => "no", | |
:frameborder => "0", | |
:style => "width:130px; height:50px;", | |
:allowTransparency => "true" } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment