14
September
2010

Gravatar Helper Method

Tagged: Rails Helper Methods
Comments
Facebook_share Twitter_share Reddit_share
You will have noticed that here on Arcath.net your Gravatar is used. To make my life easier I wrote a helper method which takes any options and returns the Gravatar url.



This helper method can be used in two ways


1gravatar_url("you@email.com")




or


1gravatar_url("you@email.com",{ :s => 80, :d => "identicon" })




The first call returns the url to the avatar without any options, the second returns the avatar scaled to 80x80 and uses the dynamic "identicon" for when the email is not used on gravatar.

Its only a basic helper method but makes using gravatar so much easier.
blog comments powered by Disqus
Html5-badge-h-css3-graphics-semantics
CSS Based on Twitters Bootstrap

88x31
All Content is written by Adam Laycock (Arcath) unless otherwise stated.

A little bit About Me

I am an IT Technician working in Primary Schools, I spend my time outside work writing programs, normally they end up bieng bots and other web based dodads