<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>firstruby &#187; firstruby</title>
	<atom:link href="http://firstruby.wordpress.com/category/firstruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://firstruby.wordpress.com</link>
	<description>Master ruby with us</description>
	<lastBuildDate>Wed, 30 Dec 2009 11:05:46 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='firstruby.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/eb6885b93aade6dc82939c09ff8b3819?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>firstruby &#187; firstruby</title>
		<link>http://firstruby.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://firstruby.wordpress.com/osd.xml" title="firstruby" />
		<item>
		<title>&#8216;ordinalize&#8217; in Ruby On Rails</title>
		<link>http://firstruby.wordpress.com/2009/07/21/ordinalize-in-ruby-on-rails/</link>
		<comments>http://firstruby.wordpress.com/2009/07/21/ordinalize-in-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 11:39:35 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=104</guid>
		<description><![CDATA[Print numbers as Cardinals in Ruby On Rails (like 1st, 2nd, 3rd, 4th and so on&#8230;.)
Rails has inbuilt function &#8211; ordinalize
(1).ordinalize =&#62; "1st"
(13).ordinalize =&#62; "13th"
(22).ordinalize =&#62; "22nd"
(100).ordinalize =&#62; "100th"
Also we can write the helper as following,
def number_to_ordinal(num)
  num = num.to_i
  if (10...20)===num
    "#{num}th"
  else
    g = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=104&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Print numbers as Cardinals in Ruby On Rails (like 1st, 2nd, 3rd, 4th and so on&#8230;.)</p>
<p>Rails has inbuilt function &#8211; <strong>ordinalize</strong></p>
<p><code>(1).ordinalize =&gt; "1st"<br />
(13).ordinalize =&gt; "13th"<br />
(22).ordinalize =&gt; "22nd"<br />
(100).ordinalize =&gt; "100th"</code></p>
<p>Also we can write the helper as following,</p>
<p><code>def number_to_ordinal(num)<br />
  num = num.to_i<br />
  if (10...20)===num<br />
    "#{num}th"<br />
  else<br />
    g = %w{ th st nd rd th th th th th th }<br />
    a = num.to_s<br />
    c=a[-1..-1].to_i<br />
    a + g[c]<br />
  end<br />
end</code></p>
<p><code>number_to_ordinal(23) =&gt; "23rd"<br />
number_to_ordinal(1) =&gt; "1st"</code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=104&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2009/07/21/ordinalize-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>ri and rdoc in Ruby On Rails</title>
		<link>http://firstruby.wordpress.com/2008/11/16/ri-and-rdoc-in-ruby-on-rails/</link>
		<comments>http://firstruby.wordpress.com/2008/11/16/ri-and-rdoc-in-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 12:57:17 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Forum]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rdoc]]></category>
		<category><![CDATA[ri]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=57</guid>
		<description><![CDATA[To install ri and rdoc of any gem,
gem install gemname
This command installs ri and rdoc with installation of gem.
To skip the installation of ri and rdoc of gem,
gem install gemname &#8211;no-ri &#8211;no-rdoc
This command will skip the installation of ri and rdoc when installing gem.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=57&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To install ri and rdoc of any gem,</p>
<p>gem install <strong>gemname</strong></p>
<p>This command installs ri and rdoc with installation of gem.</p>
<p>To skip the installation of ri and rdoc of gem,</p>
<p>gem install <strong>gemname</strong> &#8211;no-ri &#8211;no-rdoc</p>
<p>This command will skip the installation of ri and rdoc when installing gem.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=57&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2008/11/16/ri-and-rdoc-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>GIT with branches</title>
		<link>http://firstruby.wordpress.com/2008/10/31/git-with-branches/</link>
		<comments>http://firstruby.wordpress.com/2008/10/31/git-with-branches/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 10:28:21 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=53</guid>
		<description><![CDATA[In SVN,  we can create standard repository  structure like,

- trunk       &#8211; current code
- branches &#8211; versions
- tags


such as we can store the code in different branches  in GIT,

git push origin demo1.0

where demo1.0 &#8211; name of the branch
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=53&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div><span style="font-family:Arial;font-size:x-small;">In SVN,  we can create standard repository  structure like,</span></div>
<div></div>
<div><span style="font-family:Arial;font-size:x-small;">- trunk       &#8211; current code</span></div>
<div><span style="font-family:Arial;font-size:x-small;">- branches &#8211; versions</span></div>
<div><span style="font-family:Arial;font-size:x-small;">- tags</span></div>
<div></div>
<div></div>
<div><span style="font-family:Arial;font-size:x-small;">such as we can store the code in different branches  in GIT,</span></div>
<div></div>
<div><span style="font-family:Arial;font-size:x-small;">git push origin demo1.0</span></div>
<div></div>
<div><span style="font-family:Arial;font-size:x-small;">where demo1.0 &#8211; name of the branch</span></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=53&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2008/10/31/git-with-branches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Access Remote MySQL database in RubyonRails application</title>
		<link>http://firstruby.wordpress.com/2008/10/23/access-remote-mysql-database-in-rubyonrails/</link>
		<comments>http://firstruby.wordpress.com/2008/10/23/access-remote-mysql-database-in-rubyonrails/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 15:49:17 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=44</guid>
		<description><![CDATA[To give the remote access to database, on server, we have to give the following command,
mysql&#62; CREATE DATABASE foo_development;
mysql&#62; GRANT ALL ON foo_development.* TO root@'192.168.1.25' IDENTIFIED BY 'PASSWORD';
where 192.168.1.25 &#8211; IP Address of the client machine,
Now modify  ../config/database.yml file in our RoR application as follows,
development:
adapter: mysql
database: foo_development
username: root
password: PASSWORD
host: 192.168.1.1
where 192.168.1.1 &#8211; IP Address of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=44&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To give the remote access to database, on server, we have to give the following command<span style="font-size:x-small;"><span style="font-family:verdana,sans-serif;">,</span></span></p>
<p><code style="font-family:verdana,sans-serif;color:#3333ff;">mysql&gt; CREATE DATABASE foo_development;<br />
mysql&gt; GRANT ALL ON </code><span style="font-size:x-small;"><code style="font-family:verdana,sans-serif;color:#3333ff;">foo_development</code></span><span style="font-size:x-small;"><code style="font-family:verdana,sans-serif;color:#3333ff;">.* TO root@</code></span><span style="font-size:x-small;"><code style="font-family:verdana,sans-serif;color:#3333ff;">'</code></span>192.168.1.25<span style="font-size:x-small;"><code style="font-family:verdana,sans-serif;color:#3333ff;">' IDENTIFIED BY 'PASSWORD';</code></span></p>
<p>where<span style="font-size:x-small;"> </span>192.168.1.25 &#8211; IP Address of the client machine,</p>
<p>Now modify  ../config/database.yml file in our RoR application as follows,</p>
<p>development:<br />
adapter: mysql<br />
database: foo_development<br />
username: root<br />
password: PASSWORD<br />
host: 192.168.1.1</p>
<p>where 192.168.1.1 &#8211; IP Address of server</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=44&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2008/10/23/access-remote-mysql-database-in-rubyonrails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>RESTful architecture</title>
		<link>http://firstruby.wordpress.com/2008/05/29/restful-architecture/</link>
		<comments>http://firstruby.wordpress.com/2008/05/29/restful-architecture/#comments</comments>
		<pubDate>Thu, 29 May 2008 04:59:29 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Forum]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=35</guid>
		<description><![CDATA[RESTful interface means clean URLs, less code, CRUD interface.
CRUD means Create-READ-UPDATE-DESTROY.
You might heard about HTTP verbs, GET, POST. In REST, they add 2 new verbs, i.e, PUT, DELETE.
There are 7 default actions, those are &#8211; index, show, new, create, edit, update, destroy
GET is used when you retrieve data from database. POST is used when you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=35&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>RESTful interface means clean URLs, less code, CRUD interface.</p>
<p>CRUD means Create-READ-UPDATE-DESTROY.</p>
<p>You might heard about HTTP verbs, GET, POST. In REST, they add 2 new verbs, i.e, PUT, DELETE.</p>
<p>There are 7 default actions, those are &#8211; index, show, new, create, edit, update, destroy</p>
<p>GET is used when you retrieve data from database. POST is used when you create new record in database. PUT is used when you are updating any existing record in database, and DELETE is used when you are destroying any record in database.  Following table may clear the concept.</p>
<p><strong>Action</strong> <strong>VERB</strong></p>
<p>index                                                          GET</p>
<p>show                                                          GET</p>
<p>new                                                              GET</p>
<p>create                                                        POST</p>
<p>edit                          GET</p>
<p>update                      PUT</p>
<p>destroy                                                  DELETE</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/firstruby.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/firstruby.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=35&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2008/05/29/restful-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>DateTime formatting in RubyonRails</title>
		<link>http://firstruby.wordpress.com/2008/05/29/datetime-formatting-in-rubyonrails/</link>
		<comments>http://firstruby.wordpress.com/2008/05/29/datetime-formatting-in-rubyonrails/#comments</comments>
		<pubDate>Thu, 29 May 2008 04:50:48 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Forum]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[DateTime]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/?p=34</guid>
		<description><![CDATA[To display datetimes in different formats in Ruby On Rails application,
following may help,
Format meaning:
%a &#8211; The abbreviated weekday name (&#8220;Sun&#8221;)
%A &#8211; The full weekday name (&#8220;Sunday&#8221;)
%b &#8211; The abbreviated month name (&#8220;Jan&#8221;)
%B &#8211; The full month name (&#8220;January&#8221;)
%c &#8211; The preferred local date and time representation
%d &#8211; Day of the month (01..31)
%H &#8211; Hour of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=34&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To display datetimes in different formats in Ruby On Rails application,</p>
<p>following may help,</p>
<p>Format meaning:<br />
%a &#8211; The abbreviated weekday name (&#8220;Sun&#8221;)<br />
%A &#8211; The full weekday name (&#8220;Sunday&#8221;)<br />
%b &#8211; The abbreviated month name (&#8220;Jan&#8221;)<br />
%B &#8211; The full month name (&#8220;January&#8221;)<br />
%c &#8211; The preferred local date and time representation<br />
%d &#8211; Day of the month (01..31)<br />
%H &#8211; Hour of the day, 24-hour clock (00..23)<br />
%I &#8211; Hour of the day, 12-hour clock (01..12)<br />
%j &#8211; Day of the year (001..366)<br />
%m &#8211; Month of the year (01..12)<br />
%M &#8211; Minute of the hour (00..59)<br />
%p &#8211; Meridian indicator (&#8220;AM&#8221; or &#8220;PM&#8221;)<br />
%S &#8211; Second of the minute (00..60)<br />
%U &#8211; Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)<br />
%W &#8211; Week number of the current year, starting with the first Monday as the first day of the first week (00..53)<br />
%w &#8211; Day of the week (Sunday is 0, 0..6)<br />
%x &#8211; Preferred representation for the date alone, no time<br />
%X &#8211; Preferred representation for the time alone, no date<br />
%y &#8211; Year without a century (00..99)<br />
%Y &#8211; Year with century<br />
%Z &#8211; Time zone name<br />
%% &#8211; Literal &#8220;%&#8221; character</p>
<p>For example,</p>
<p>t = Time.now<br />
t.strftime(&#8220;Printed on %m/%d/%Y&#8221;) #=&gt; &#8220;Printed on 04/09/2003&#8243;<br />
t.strftime(&#8220;at %I:%M%p&#8221;) #=&gt; &#8220;at 08:56AM&#8221;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/firstruby.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/firstruby.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=34&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2008/05/29/datetime-formatting-in-rubyonrails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby Gems</title>
		<link>http://firstruby.wordpress.com/2007/02/04/ruby-gems/</link>
		<comments>http://firstruby.wordpress.com/2007/02/04/ruby-gems/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 09:22:16 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/2007/02/04/ruby-gems/</guid>
		<description><![CDATA[Using Ruby Gems
You may want to add functionality to your application using Ruby Gems. A gem is a packaged Ruby application or library. A great introduction to Ruby Gems can be found here. Basically, Ruby Gems keep you from having to reinvent the wheel, by providing you with modular pieces of code that can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=19&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3><strong>Using Ruby Gems</strong></h3>
<p><font size="3"><font face="Times New Roman, serif">You may want to add functionality to your application using Ruby Gems. </font></font>A gem is a packaged Ruby application or library. A great introduction to Ruby Gems can be found <a href="http://www.rubygems.org/">here</a>. Basically, Ruby Gems keep you from having to reinvent the wheel, by providing you with modular pieces of code that can be accessed from within your application&#8217;s code.</p>
<p>By default, some gems will come pre-installed with your hosting plan. Generally these are Rails-relevant gems (ActiveRecord, ActionMailer, etc.). To see a list of installed gems at any time, type “gem list &#8211;local” from an SSH window.</p>
<p>To install new gems, issue the command “gem install &lt;gem-name&gt;” (where &lt;gem-name&gt; is the name of the gem you wish to install). This command will first search your local machine for the specified gem, and if not found, will attempt to automatically download the gem from <a href="http://rubyforge.org/">RubyForge</a>, an online gem repository. Check <a href="http://www.rubyforge.com/">RubyForge</a> for a complete listing of available gems or check the link here for a more condensed listing. More installation options can be found by typing “gem install &#8211;help”.</p>
<p>By default, gems will be installed to &#8216;/usr/lib/ruby/gems/1.8/gems/&#8217;.</p>
<h3><strong>Freezing Ruby Gems</strong></h3>
<p><font face="Times New Roman, serif"><font size="3">Whenever a new gem version appears on the host, your Rails application will attempt to automatically upgrade to that version. This is convenient when in development, but after moving to production, it can cause things to break unexpectedly. For obvious reasons, you don&#8217;t necessarily want your application being updated after it has been published. To prevent gems from updating, change directories to your application root, and issue the command “rake freeze_gems”. This copies the gems from /usr/lib/ruby/gems/1.8/gems/ (the default location) to &lt;your-app-name&gt;/vendor/ and keeps them from being automatically updated.</font></font><font face="Times New Roman, serif"><font size="3"><font face="Times New Roman, serif"><font size="3">There is one caveat with the “rake freeze_gems” command. It will only freeze gems that are Rails-relevant. If running this command doesn&#8217;t freeze the gem(s) you want it to, (i.e. they are not found in &lt;app-name&gt;/vendor/) you will need to use the solution found <a href="http://nubyonrails.com/articles/2005/12/22/freeze-other-gems-to-rails-lib-directory">here</a>. </font></font><br />
<font size="3"><font face="Times New Roman, serif">This section is intended only to give a brief introduction to concept of freezing gems. If this is something you are interested in doing, it is highly recommended that you read up on the documentation at </font></font><a href="http://www.rubygems.org/"><font size="3"><font face="Times New Roman, serif">http://www.rubygems.org</font></font></a><font size="3"><font face="Times New Roman, serif"> for more information.</font></font></font></font></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/firstruby.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/firstruby.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=19&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2007/02/04/ruby-gems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Mongrel_server</title>
		<link>http://firstruby.wordpress.com/2007/01/05/mongrel_server/</link>
		<comments>http://firstruby.wordpress.com/2007/01/05/mongrel_server/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 06:56:59 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/2007/01/05/mongrel_server/</guid>
		<description><![CDATA[Getting Started
The easiest way to get started with Mongrel is to install it via RubyGems and then run a Ruby on Rails application. You can do this easily:
               gem install win32-service (pick the most recent one)
               gem install mongrel (pick the win32 pre-built)
Win32 Support
Win32 is fully supported by Mongrel with services and CPU affinity support.
The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=16&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h2>Getting Started</h2>
<p>The easiest way to get started with Mongrel is to install it via RubyGems and then run a Ruby on Rails application. You can do this easily:</p>
<p><em>               gem install win32-service</em> (pick the most recent one)<br />
               <em>gem install mongrel </em>(pick the win32 pre-built)</p>
<h2>Win32 Support</h2>
<p>Win32 is fully supported by Mongrel with services and <span class="caps">CPU</span> affinity support.</p>
<p>The main thing with Win32 support is that there is no <strong>fork</strong> <span class="caps">API</span> for Ruby, so you have to use the services features to get persistent servers running. You can get this services support by doing:</p>
<p>              <em>gem install mongrel_service</em></p>
<p>And then just run <code>mongrel_rails</code> to see what <code>services::</code> commands are available.</p>
<h2>Running The Service</h2>
<p>After you do the gem install, find a Rails application you want to run and do:</p>
<pre><code>$ mongrel_rails service::install -N myapp <a href="///">\\ </a>
       -c c:mypathtomyapp -p 4000 -e production
       $ mongrel_rails service::start -N myapp</code></pre>
<p>Now hit the port and poof, works (or should).</p>
<p>The application will stop if you use:</p>
<pre><code>$ mongrel_rails service::stop -N myapp</code></pre>
<p><code>NOTE: Stop reports an exception but does stop the service.</code></p>
<p>Now the really great thing is that you can just do all this from the Services control panel like your Rails application is a regular Windows service.</p>
<p>Even works in development mode, which is pretty nice.</p>
<h2>Making you Service autostart with Windows</h2>
<p>By default, the new Mongrel service get installed to be run <em>manually</em>, using Mongrel’s commands or the Service Manager. You could tweak it to start automatically when Windows start, just use the Service Control commandline tool:</p>
<pre><code>$ sc config myapp start=auto</code></pre>
<p>Also, you can configure the services that are neede to make it work, like database support:</p>
<pre><code>$ sc config myapp start=auto dependency=MySql</code></pre>
<pre><code></code> </pre>
<h2><span class="caps">CPU</span> Affinity</h2>
<p>Mongrel’s win32 support actually is able to set the <span class="caps">CPU</span> affinity of a running Mongrel service. This is pretty neat since it means if you’re running a fancy <span class="caps">SMP</span> machine or a dual core that pretends to be <span class="caps">SMP</span>, then you can force Mongrel onto one of them and get a nice little boost.</p>
<p>It’s pretty easy to use, just pass the <strong>-u or—cpu</strong> option to the <strong>install</strong> command and give a <span class="caps">CPU</span> of 1-X. That means if you have 4 CPUs and you want Mongrel on #4 then do:</p>
<pre><code>$ mongrel_rails service::install -N myapp
       -c c:mypathtomyapp -p 4000 -e production -u 4</code></pre>
<p>Pretty much the same command, just one more option and you’re done.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/firstruby.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/firstruby.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=16&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2007/01/05/mongrel_server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome</title>
		<link>http://firstruby.wordpress.com/2006/12/13/welcome/</link>
		<comments>http://firstruby.wordpress.com/2006/12/13/welcome/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 17:27:50 +0000</pubDate>
		<dc:creator>firstruby</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Useful Links]]></category>
		<category><![CDATA[firstruby]]></category>

		<guid isPermaLink="false">http://firstruby.wordpress.com/2006/12/13/welcome/</guid>
		<description><![CDATA[Welcome to learn Ruby,
Now you can download &#8216;Radrails (version 0.7.2)&#8217; editor for developing Ruby On Rails application for Windows, Mac OSX and Linux at

Download Radrails 0.7.2
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=7&subd=firstruby&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to learn Ruby,</p>
<p>Now you can <strong>download &#8216;Radrails (version 0.7.2)&#8217;</strong> editor for developing Ruby On Rails application for Windows, Mac OSX and Linux at</p>
<p><a href="http://sourceforge.net/project/showfiles.php?group_id=155448&amp;package_id=173164&amp;release_id=469210"><br />
Download Radrails 0.7.2</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/firstruby.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/firstruby.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/firstruby.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/firstruby.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/firstruby.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/firstruby.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/firstruby.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/firstruby.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/firstruby.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/firstruby.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/firstruby.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/firstruby.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=firstruby.wordpress.com&blog=520515&post=7&subd=firstruby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://firstruby.wordpress.com/2006/12/13/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e5161c5b9908a6e81639e34a22cf2b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">firstruby</media:title>
		</media:content>
	</item>
	</channel>
</rss>