Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Created January 17, 2012 00:30
Show Gist options
  • Save hexgnu/1623799 to your computer and use it in GitHub Desktop.
Save hexgnu/1623799 to your computer and use it in GitHub Desktop.
Hrm haml
- if network.is_a?(TwitterNetwork)
%span{:class => network.class.to_s.downcase}
= truncate(network.name.to_s, :length => 20)
%br
%span
%a.network_url{:href => "http://twitter.com/#{network.name}"}
= "twitter.com/#{network.name}"
- elsif network.is_a?(FacebookNetwork)
%span{:class => network.class.to_s.downcase}
= truncate(network.name.to_s, :length => 20)
%br
%span
%a.network_url{:href => "http://facebook.com/profile.php?id=#{network.identifier}"}
= "facebook.com/#{network.identifier}"
VS
%span{:class => network.type.downcase}
= truncate(network.name, :length => 20)
%br
%span
%a.network_url{:href => network.canonical_url}
= network.canonical_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment