<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.sketchit.de &#187; Ruby</title>
	<atom:link href="http://blog.sketchit.de/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sketchit.de</link>
	<description>Glaubt mir ich hab den Weihnachtsmann mit eigenen Augen gesehen...</description>
	<lastBuildDate>Mon, 31 Oct 2011 10:21:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Gravata für Ruby on Rails</title>
		<link>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/</link>
		<comments>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 15:32:23 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=134</guid>
		<description><![CDATA[Hier gefunden: http://overhrd.com/?p=28 Um Gravatar für Ruby on Rails zu verwenden, ist lediglich eine kleine Methode im Application Helper nötig und deren Aufruf in der View. application_helper.rb require 'digest/md5' def gravatar_url_for(email, options = {}) url_for({ :gravatar_id =&#62; Digest::MD5.hexdigest(email), :host =&#62; 'www.gravatar.com', :protocol =&#62; 'http://', nly_path =&#62; false, :controller =&#62; 'avatar.php'}.merge(options)) end View (z. B. index.html.erb) [...]]]></description>
			<content:encoded><![CDATA[<p>Hier gefunden: <a href="http://overhrd.com/?p=28" target="_blank">http://overhrd.com/?p=28</a></p>
<p>Um Gravatar für Ruby on Rails zu verwenden, ist lediglich eine kleine Methode im Application Helper nötig und deren Aufruf in der View.</p>
<p>application_helper.rb</p>
<pre name="code" class="ruby">require 'digest/md5'

  def gravatar_url_for(email, options = {})
    url_for({ :gravatar_id =&gt; Digest::MD5.hexdigest(email),
      :host =&gt; 'www.gravatar.com',
      :protocol =&gt; 'http://',
      <img src='http://blog.sketchit.de/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly_path =&gt; false,
      :controller =&gt; 'avatar.php'}.merge(options))
  end</pre>
<p>View (z. B. index.html.erb)</p>
<pre name="code" class="ruby"># plain old gravatar url

&lt;%= gravatar_url_for 'info@sketchit.de' %&gt;

# gravatar url with a rating threshold

&lt;%= gravatar_url_for 'info@sketchit.de', { :rating =&gt; 'R' } %&gt;

# show the avatar

&lt;%= image_tag(gravatar_url_for 'info@sketchit.de') %&gt;

# show the avatar with size specified, in case it's served slowly

&lt;%= image_tag(gravatar_url_for('info@sketchit.de'), { :width =&gt; 80, :height =&gt; 80 }) %&gt;

# link the avatar to some/url

&lt;%= link_to(image_tag(gravatar_url_for 'info@sketchit.de'), 'some/url')%&gt;</pre>
<p>Die oben definierte Methode nimmt die übergebene E-Mail Adresse, wandelt es in einen MD5 Hash um, baut daraus die URL von Gravatar zusammen (http://www.gravatar.com/avatar.php?gravatar_id=HASH_WERT) und liefert den Avatar zurück.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

