SocialIcons

This is a simple plugin to help you display some social icons in your site.

Icons supported so far:

  • Facebook like button

  • Facebook

  • Twitter

  • Delicious

  • Reddit

  • Digg

  • Youtube (and many more…)

Installation

This gem is a Rails 3 engine and the asset folder will therefore be included in the Rails asset pipeline when the gem is included in your Rails 3 project.

Load social_icons.css file in your layout(i.e. application.html.erb)

<%= stylesheet_link_tag ‘social_icons’ %>

Or simply include the css in your application.css manifest file

Note that the icons are now available for use as CSS sprites (conversion done using: spritegen.website-performance.org/)

Simply include the css for the type of icons you want to use.

/*

*= require social_icons

*/

/*

*= require social_icons_default_60

*/

/*

*= require social_icons_aqua

*/

Usage

Wrap with an element of class=“social_sprites”

<ul class=“social_sprites s16”> <li class=“social sprite-Google”></li> </ul>

<ul class=“social_sprites s48”> <li class=“social sprite-Google”></li> </ul>

<ul class=“social_sprites aqua”> <li class=“social sprite-Google”></li> </ul>

View Helper methods

Call “print_social_icons” method in your partials or views.

<%= print_social_icons %>

Specific icon methods:

  • facebook_like_button

  • social_icon_twitter

  • social_icon_facebook

  • social_icon_digg

  • social_icon_delicious

  • social_icon_reddit

Rails 3 CSS sprite version by Kristian Mandrup ([email protected])

Copyright © 2010 [Özgun Koyun ([email protected])], released under the MIT license