Skip to content

Instantly share code, notes, and snippets.

@reu
Created March 23, 2011 16:27
Show Gist options
  • Save reu/883390 to your computer and use it in GitHub Desktop.
Save reu/883390 to your computer and use it in GitHub Desktop.
# encoding: UTF-8
module ApplicationHelper
def sharing_on_social_networks(subject)
social_networks = {}
social_networks[:twitter] = "http://twitter.com/share?text=Estou vendo #{truncate(subject, :length => 60)} na página da Soulfitness. Veja também em&url=http://www.soulfitness.com.br"
String.new.html_safe.tap do |output|
social_networks.each_pair do |key, value|
output << link_to(image_tag(key.to_s + ".png", :width => 21, :height => 21), value, :class => key, :target => "_blank")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment