<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rails all the way</title>
	<atom:link href="http://agilerails.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://agilerails.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<pubDate>Fri, 04 Jan 2008 11:28:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>time_zone_select showing only US time zones</title>
		<link>http://agilerails.wordpress.com/2008/01/04/time_zone_select-showing-only-us-time-zones/</link>
		<comments>http://agilerails.wordpress.com/2008/01/04/time_zone_select-showing-only-us-time-zones/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 11:20:12 +0000</pubDate>
		<dc:creator>agilerails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[time_zone_select rails US time_zones]]></category>

		<guid isPermaLink="false">http://agilerails.wordpress.com/2008/01/04/time_zone_select-showing-only-us-time-zones/</guid>
		<description><![CDATA[time_zone_select produces option tags for almost any time zones in the world but if you want the list of US time zones only,  without using the TZInfo library then you should add a file under the lib directory say us.rb and add the following code

class US
&#160;def self.all
&#160;&#160;TimeZone.us_zones
&#160;end
end

and in you views use

&#60;%= time_zone_select object, method, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>time_zone_select produces option tags for almost any time zones in the world but if you want the list of US time zones only,  <u>without using the TZInfo library</u> then you should add a file under the <i>lib directory </i>say <i><u>us.rb</u> </i>and add the following code<br />
<code><br />
class US<br />
&nbsp;def self.all<br />
&nbsp;&nbsp;TimeZone.us_zones<br />
&nbsp;end<br />
end<br />
</code><br />
and in you views use<br />
<code><br />
&lt;%= time_zone_select object, method, nil, :model=&gt;US  %&gt;<br />
</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/agilerails.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/agilerails.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/agilerails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/agilerails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/agilerails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/agilerails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/agilerails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/agilerails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/agilerails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/agilerails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/agilerails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/agilerails.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=agilerails.wordpress.com&blog=547632&post=13&subd=agilerails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://agilerails.wordpress.com/2008/01/04/time_zone_select-showing-only-us-time-zones/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Etag in Edge Rails</title>
		<link>http://agilerails.wordpress.com/2007/09/03/etag-in-edge-rails/</link>
		<comments>http://agilerails.wordpress.com/2007/09/03/etag-in-edge-rails/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 19:50:51 +0000</pubDate>
		<dc:creator>agilerails</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[etag edge rails]]></category>

		<guid isPermaLink="false">http://agilerails.wordpress.com/2007/09/03/etag-in-edge-rails/</guid>
		<description><![CDATA[What is an ETag and How does it work??
When a request is made for the first time then during page render, etag header is automatically inserted on 200 OK responses. The etag is calculated using MD5 of the response body.
On subsequent requests the etag is send along as  request.headers['HTTP_IF_NONE_MATCH']  and compared with response.headers['ETAG'] [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><blockquote><b>What is an ETag and How does it work??</b></p></blockquote>
<blockquote><p>When a request is made for the first time then during page render, etag header is automatically inserted on 200 OK responses. The etag is calculated using MD5 of the response body.<br />
On subsequent requests the etag is send along as  <i>request.headers['HTTP_IF_NONE_MATCH']</i>  and compared with <i>response.headers['ETAG']</i> . If they are equal then the response is changed to a <i>304 Not Modified</i> and the response body is set to an empty string.</p></blockquote>
<blockquote><p><b>So how does that help??</b></p>
<p>ETag is used to expire the browser caching and for saving transfer of course!!<br />
- aggregators can tell which version of feed they have and thus server sends data only if some newer version is there.<br />
- no more cache based on page expiration.</p></blockquote>
<p><b>A ruby snippet for showing ETags</b><br />
<code><br />
require &#8216;net/http&#8217;<br />
# my rails app running on edge rails<br />
http = Net::HTTP.new(&#8221;localhost&#8221;, 3000)</code><br />
<code><br />
# /controller/action<br />
data = http.get2(&#8221;/say&#8221;)</code><br />
<code><br />
p data.body<br />
p data.header.each{|k,v| p &#8220;#{k} = #{v}&#8221;}</code><br />
<code><br />
data2 = http.request_get(&#8221;/say&#8221;, {&#8217;If-None-Match&#8217;=&gt;data.header['etag']})</code><br />
<code><br />
p data2.body<br />
p data2.header.each{|k,v| p &#8220;#{k} = #{v}&#8221;}<br />
# <i>304 not modified</i> n <i>body</i> empty coz of no change in content</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/agilerails.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/agilerails.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/agilerails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/agilerails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/agilerails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/agilerails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/agilerails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/agilerails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/agilerails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/agilerails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/agilerails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/agilerails.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=agilerails.wordpress.com&blog=547632&post=12&subd=agilerails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://agilerails.wordpress.com/2007/09/03/etag-in-edge-rails/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>