July 4th, 2010 15:38   |   Category: Ruby on Rails

I’ve created a simple Rails plugin called Social Icons to put social media/network icons to your website easily.

Installation:

$ ./script/plugin install git://github.com/ozgun/social_icons.git

The command above will copy a simple css(social_icons.css) file to “public/stylesheets” folder and “social_icons” folder to “public/images” folder.

Although it is not necessary, you can load css file like above: (i.e. application.html.erb)

<%= stylesheet_link_tag 'social_icons' %>

Usage:

You can call “print_social_icons” method in your views or partials.

<%= print_social_icons %>

Icons supported so far:

  • Facebook like button
  • Facebook
  • Twitter
  • Delicious
  • Reddit
  • Digg

Images (Icon pack)

“social.me” icons from “Quaqe9” are used.

Showtime:

Links: