<?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>TM is on Rails</title>
	<atom:link href="http://tmonrails.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tmonrails.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 22 Dec 2009 18:55:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tmonrails.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>TM is on Rails</title>
		<link>http://tmonrails.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tmonrails.wordpress.com/osd.xml" title="TM is on Rails" />
	<atom:link rel='hub' href='http://tmonrails.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Basic PayPal</title>
		<link>http://tmonrails.wordpress.com/2009/12/22/basic-paypal/</link>
		<comments>http://tmonrails.wordpress.com/2009/12/22/basic-paypal/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:54:04 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=60</guid>
		<description><![CDATA[RyanB&#8217;s Railscasts provided the perfect example to adding PayPal functionality to your application, http://railscasts.com/episodes/141-paypal-basics. But what if let say you don&#8217;t wanna do a cart system but instead you want the site to take you directly to the payment section in one click. With that of course, you can&#8217;t have the user selecting items into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=60&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>RyanB&#8217;s Railscasts provided the perfect example to adding PayPal functionality to your application, <a href="http://railscasts.com/episodes/141-paypal-basics">http://railscasts.com/episodes/141-paypal-basics</a>.</p>
<p>But what if let say you don&#8217;t wanna do a cart system but instead you want the site to take you directly to the payment section in one click. With that of course, you can&#8217;t have the user selecting items into the cart but that would do if you are charging all users the same price for the same item.</p>
<p>In the view, we will need a link_to taking us to the payment site on PayPal. We can also use a form to have it sent as a POST method if we are concern about the details in the url.</p>
<p>Based on RyanB&#8217;s tutorial, we will need a <a href="https://developer.paypal.com/">sandbox account</a> to play with this kinda stuff before firing up the real deal. </p>
<p>models/user.rb<br />
def paypal_url(return_url)<br />
    values = {<br />
      :business =&gt; &#8216;sell_1261499871_biz@live.com&#8217;,<br />
      :cmd =&gt; &#8216;_xclick&#8217;,<br />
      :return =&gt; return_url,<br />
      :invoice =&gt; id<br />
    }<br />
      values.merge!({<br />
        &#8220;amount&#8221; =&gt; 500,<br />
        &#8220;item_name&#8221; =&gt; &#8220;Registration&#8221;<br />
      })<br />
    &#8220;https://www.sandbox.paypal.com/cgi-bin/webscr?&#8221; + values.to_query<br />
  end</p>
<p>So now when we go ahead and click the &#8220;Pay Up Now!&#8221; link, we will be redirected to the PayPal site where we are gonna pay for a registration fee of $500&#8230;</p>
<p>You may like to refer to the <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=developer/library_documentation">documentation</a> and <a href="https://cms.paypal.com/us/cgi-bin/?&amp;cmd=_render-content&amp;content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables">HTML variables</a> for more info and features.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=60&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/12/22/basic-paypal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails Session</title>
		<link>http://tmonrails.wordpress.com/2009/12/08/rails-session/</link>
		<comments>http://tmonrails.wordpress.com/2009/12/08/rails-session/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:46:42 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=52</guid>
		<description><![CDATA[A very trivial try, def session_string if session[:storage].nil? session[:storage] = "Hi! i reside in the session storage." else session[:storage] end This action checks whether the session[:storage] is nil? If it is, then just put a string into it. If it isn&#8217;t then the action will just return the session. puts session[:storage] It will display the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=52&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A very trivial try,</p>
<p><code><br />
def session_string<br />
if session[:storage].nil?<br />
session[:storage] = "Hi! i reside in the session storage."<br />
else<br />
session[:storage]<br />
end<br />
</code><br />
This action checks whether the session[:storage] is nil? If it is, then just put a string into it. If it isn&#8217;t then the action will just return the session.</p>
<p><code><br />
puts session[:storage]<br />
</code><br />
It will display the string stored in the session.</p>
<p>A lil part i picked, from the Agile Development Rails book,</p>
<p><code><br />
def find_cart<br />
unless(session[:cart])<br />
session[:cart] = Cart.new<br />
end<br />
session[:cart]<br />
end<br />
</code></p>
<p>This action will check if a session[:cart] is nil or contains a cart. If it doesn&#8217;t then create a new Cart object and store it into the session. If there is, then it will just return the session[:cart] which contains a former Cart object in it.</p>
<p>Session is stored in a cookie by default in Rails. So each browser will have its own session storage and will interact differently between different clients.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=52&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/12/08/rails-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>JQuery on Rails</title>
		<link>http://tmonrails.wordpress.com/2009/09/03/jquery-on-rails/</link>
		<comments>http://tmonrails.wordpress.com/2009/09/03/jquery-on-rails/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 23:04:07 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=35</guid>
		<description><![CDATA[I am starting to test out JQuery on Rails and see if i can reproduce the same result of what i did back then with the Rails bundled Prototype helpers. in rjs, (js.rjs) page.replace_html "widget-count-#{@post.id}", :partial =&#62; 'widget_count', :locals =&#62; {:post =&#62; @post} page.replace "widget-button-#{@post.id}", image_tag('wiggy.png') in jquery, (js.erb) $("#widget-count-&#60;%= @post.id %&#62;").replaceWith ('&#60;%= escape_javascript(render(:partial =&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=35&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am starting to test out JQuery on Rails and see if i can reproduce the same result of what i did back then with the Rails bundled Prototype helpers.</p>
<p>in rjs, (js.rjs)<br />
<code><br />
page.replace_html "widget-count-#{@post.id}", :partial =&gt; 'widget_count', :locals =&gt; {:post =&gt; @post}<br />
page.replace "widget-button-#{@post.id}", image_tag('wiggy.png')<br />
</code><br />
in jquery, (js.erb)<br />
<code><br />
$("#widget-count-&lt;%= @post.id %&gt;").replaceWith<br />
('&lt;%= escape_javascript(render(:partial =&gt; 'widget_count', :locals =&gt; {:post =&gt; @post} ))%&gt;');<br />
$("#widget-button-&lt;%= @post.id %&gt;").replaceWith<br />
('&lt;%= image_tag('wiggy.png') %&gt;');</code></p>
<p>in addition to that, if you are using JQuery, do not forget to import that JQuery javascript file.</p>
<p>However, if you are dealing with ajax request&#8230; there is something extra you need to do. Based on RyanB&#8217;s railscast at <a href="http://railscasts.com/episodes/136-jquery">http://railscasts.com/episodes/136-jquery</a>,</p>
<p>in application.js</p>
<p>#to request for js format by default instead of html if you have both respond_to |format|</p>
<p><code>jQuery.ajaxSetup({<br />
'beforeSend' : function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}<br />
})</code></p>
<p>#Changing the behavior of the form, note the form id &#8220;new_comment&#8221; to submit an ajax request</p>
<p><code>$(document).ready(function(){<br />
$("#new_comment").submit(function(){<br />
$.post($(this).attr("action"), $(this).serialize(), null, "script");<br />
return false<br />
})<br />
})</code></p>
<p>JQuery.js has to be loaded first before application.js in order to get it work.</p>
<p>Then for the appearance of the comment in an ajax manner,</p>
<p>in rjs, (js.rjs)<br />
<code><br />
if @comment.save<br />
page.insert_html :top,"comments", :partial =&gt; 'comment'</code></p>
<p>in jquery, (js.erb)</p>
<p><code>&lt;% if @comment.save %&gt;<br />
$("#comments").prepend("&lt;%= escape_javascript(render :partial =&gt; 'comment') %&gt;")<br />
&lt;% end %&gt;</code></p>
<p>Finally if you intend to use JQuery with other Javascript libraries, Prototype for example, bear in mind the need to declare noconflict. <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries">http://docs.jquery.com/Using_jQuery_with_Other_Libraries</a></p>
<p>One of the example to prevent conflict between JQuery and Prototype is by,</p>
<p>Add this right after the libraries are loaded. Perhaps in application.js</p>
<p><code>jQuery.noConflict();</code></p>
<p>Then anytime you intend to use JQuery libraries wrap the JQuery codes inside the jQuery(document).ready(function($){ #jquery codes }) as such,</p>
<p><code>jQuery(document).ready(function($){<br />
&lt;% if @comment.save %&gt;<br />
$("#comments").prepend("&lt;%= escape_javascript(render :partial =&gt; 'comment') %&gt;");<br />
&lt;% else %&gt;<br />
alert('NO!');<br />
&lt;% end %&gt;<br />
})</code></p>
<p>The $(element) codes without wrapping into jQuery will be treated as Prototype and the score is settled.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=35&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/09/03/jquery-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby Setter and Getter Methods</title>
		<link>http://tmonrails.wordpress.com/2009/08/05/ruby-setter-and-getter-methods/</link>
		<comments>http://tmonrails.wordpress.com/2009/08/05/ruby-setter-and-getter-methods/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 13:30:07 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Getter]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Setter]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=29</guid>
		<description><![CDATA[class Person def initialize(name,age) @name = name @age = age end def name=(name) @name = name end def age=(age) @age = age end def name @name end def age @age end can be written with class Person attr_accessor :name, :age def initialize(name,age) @name = name @age = age end By using attr_accessor, you will automatically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=29&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote><p>class Person</p>
<p>def initialize(name,age)</p>
<p>@name = name</p>
<p>@age = age</p>
<p>end</p>
<p>def name=(name)</p>
<p>@name = name</p>
<p>end</p>
<p>def age=(age)</p>
<p>@age = age</p>
<p>end</p>
<p>def name</p>
<p>@name</p>
<p>end</p>
<p>def age</p>
<p>@age</p>
<p>end</p></blockquote>
<p>can be written with</p>
<blockquote><p>class Person</p>
<p>attr_accessor :name, :age</p>
<p>def initialize(name,age)</p>
<p>@name = name</p>
<p>@age = age</p>
<p>end</p></blockquote>
<p>By using attr_accessor, you will automatically get the setter and getter method. Take note that there are some hashes following it.</p>
<p>If you only want the setter method, go for attr_writer, while the getter method, go for attr_reader.</p>
<p>While it is also possible to use attr :name to get attr_reader, and attr :name, true to get the same effect as attr_accessor, but it looks less readable than the previous ones.</p>
<p>Using setter, the set method becomes similar to variable assignment when it&#8217;s actually a method call.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=29&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/08/05/ruby-setter-and-getter-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails 2.3 Model Nested Form</title>
		<link>http://tmonrails.wordpress.com/2009/07/07/rails-2-3-model-nested-form/</link>
		<comments>http://tmonrails.wordpress.com/2009/07/07/rails-2-3-model-nested-form/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 04:51:53 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=24</guid>
		<description><![CDATA[http://railscasts.com/episodes/73-complex-forms-part-1 http://railscasts.com/episodes/74-complex-forms-part-2 http://railscasts.com/episodes/75-complex-forms-part-3 Ryan made a great introduction about having a form dealing with multiple models. Yet in Rails 2.3 due to popular demand, it is already bundled with this feature. http://weblog.rubyonrails.org/2009/1/26/nested-model-forms http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes http://stackoverflow.com/questions/818460/problems-with-nested-form-fields-showing-up First of all, the model has to know about the nested attributes. With that the course can access the sections_attributes. class [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=24&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://railscasts.com/episodes/73-complex-forms-part-1</p>
<p>http://railscasts.com/episodes/74-complex-forms-part-2</p>
<p>http://railscasts.com/episodes/75-complex-forms-part-3</p>
<p>Ryan made a great introduction about having a form dealing with multiple models. Yet in Rails 2.3 due to popular demand, it is already bundled with this feature.</p>
<p>http://weblog.rubyonrails.org/2009/1/26/nested-model-forms</p>
<p>http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes</p>
<p>http://stackoverflow.com/questions/818460/problems-with-nested-form-fields-showing-up</p>
<p>First of all, the model has to know about the nested attributes. With that the course can access the sections_attributes.</p>
<blockquote><p>class Course &lt; ActiveRecord::Base<br />
has_many :sections</p>
<p>accepts_nested_attributes_for :sections</p>
<p>end</p></blockquote>
<p>Then for the view at new.html.erb</p>
<blockquote><p>&lt;% form_for @course do |course_form| %&gt;</p>
<p>&lt;%= course_form.label :title %&gt;<br />
&lt;%= course_form.text_field :title %&gt;</p>
<p>&lt;% course_form.fields_for :sections do |section_form| %&gt;</p>
<p>&lt;%= section_form.label :sec %&gt;<br />
&lt;%= section_form.text_field :sec %&gt;</p>
<p>&lt;% end %&gt;</p>
<p>&lt;%= submit_tag %&gt;<br />
&lt;% end %&gt;</p></blockquote>
<p>In the controller, there is a need to add @course.sections.build at the new action in order to populate the form and create the section together with the course in a hash.</p>
<blockquote><p>def new<br />
@course = Course.new<br />
@course.sections.build<br />
end</p></blockquote>
<p>But, wait there is more&#8230; you might wanna add more sections dynamically&#8230; and i found a tutorial that just do that</p>
<p>http://railsforum.com/viewtopic.php?id=28447</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=24&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/07/07/rails-2-3-model-nested-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending Email via Gmail on Rails</title>
		<link>http://tmonrails.wordpress.com/2009/07/02/sending-email-via-gmail-on-rails/</link>
		<comments>http://tmonrails.wordpress.com/2009/07/02/sending-email-via-gmail-on-rails/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 11:10:21 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=20</guid>
		<description><![CDATA[If you need to send an email via Gmail on a Rails application ( and if you are running Rails &#62;= 2.2.1 with Ruby 1.8.6 ) 1) Register a gmail account 2) Install the ActionMailer_tls gem from http://github.com/openrain/action_mailer_tls/tree/master 3) Follow the instruction on the readme of the Gem, To install the gem (the preferred way):1. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=20&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you need to send an email via Gmail on a Rails application ( and if you are running Rails &gt;= 2.2.1 with Ruby 1.8.6 )</p>
<p>1) Register a gmail account</p>
<p>2) Install the ActionMailer_tls gem from <a href="http://github.com/openrain/action_mailer_tls/tree/master">http://github.com/openrain/action_mailer_tls/tree/master</a></p>
<p>3) Follow the instruction on the readme of the Gem,</p>
<ul>
<li>To install the gem (the preferred way):1. `sudo gem install openrain-action_mailer_tls -s http://gems.github.com`<br />
2. `./script/generate action_mailer_tls`<br />
3. Copy RAILS_ROOT/config/smtp_gmail.yml.sample to RAILS_ROOT/config/smtp_gmail.yml<br />
4. Update the configuration file with your settings by keying in your gmail username and password on smtp_gmail.yml</li>
</ul>
<p>Make sure the username includes @gmail.com in the smtp_gmail.yml file<br />
:user_name: testing123@gmail.com<br />
:password:  thisisatestpassword</p>
<p>And you are good to go, in order to test if the mail is actually sent, follow the testing instruction in the README.</p>
<p>Thanks to <a title="http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/" href="http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/">http://www.justinball.com/2009/06/25/sending-email-with-ruby-on-rails-2-3-2-and-gmail/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=20&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/07/02/sending-email-via-gmail-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Vote_fu Sort Order by Vote_for</title>
		<link>http://tmonrails.wordpress.com/2009/06/12/vote_fu-sort-order-by-vote_for/</link>
		<comments>http://tmonrails.wordpress.com/2009/06/12/vote_fu-sort-order-by-vote_for/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 18:14:07 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/2009/06/12/vote_fu-sort-order-by-vote_for/</guid>
		<description><![CDATA[@stories = Story.tally( :conditions =&#62; {:votes =&#62; {:vote =&#62; true}}).paginate :page =&#62; params[:page], :per_page =&#62; 8 After several attempts, i tried putting this condition, and it seems as if the data are sorted according to the number of vote_for it&#8230; It has already included the association table in the plugin perhaps.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=19&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>@stories = Story.tally( :conditions =&gt; {:votes =&gt; {:vote =&gt; true}}).paginate :page =&gt; params[:page], :per_page =&gt; 8</p>
<p>After several attempts, i tried putting this condition, and it seems as if the data are sorted according to the number of vote_for it&#8230;</p>
<p>It has already included the association table in the plugin perhaps.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=19&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/06/12/vote_fu-sort-order-by-vote_for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Query</title>
		<link>http://tmonrails.wordpress.com/2009/06/12/database-query/</link>
		<comments>http://tmonrails.wordpress.com/2009/06/12/database-query/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 18:10:30 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/2009/06/12/database-query/</guid>
		<description><![CDATA[I was having some problem with database querying&#8230; googled around, and maybe i should remember to come back to this if i were to encounter them again http://guides.rubyonrails.org/active_record_querying.html http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-easy-join-table-conditions<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=18&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was having some problem with database querying&#8230; googled around, and maybe i should remember to come back to this if i were to encounter them again</p>
<p>http://guides.rubyonrails.org/active_record_querying.html</p>
<p>http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html</p>
<p>http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-easy-join-table-conditions</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=18&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/06/12/database-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Pagination</title>
		<link>http://tmonrails.wordpress.com/2009/06/09/pagination/</link>
		<comments>http://tmonrails.wordpress.com/2009/06/09/pagination/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 07:53:31 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=13</guid>
		<description><![CDATA[Pagination is used tomanage the population data in a single view such as having.. 1 &#124; 2 &#124; 3 &#124; next&#8230; The complete how-tos are at http://wiki.rubyonrails.org/howtos/pagination or page 521 Pragmatic Agile Web Development with Rails 3rd Edition .paginate is similar to .find but it&#8217;s able to support the argument for :page =&#62; params[:page] It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=13&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">Pagination is used tomanage the population data in a single view such as having..</p>
<p style="text-align:left;">1 | 2 | 3 | next&#8230;</p>
<p style="text-align:left;">The complete how-tos are at <a title="http://wiki.rubyonrails.org/howtos/pagination" href="http://wiki.rubyonrails.org/howtos/pagination">http://wiki.rubyonrails.org/howtos/pagination</a> or page 521 Pragmatic Agile Web Development with Rails 3rd Edition</p>
<p style="text-align:left;">
<p style="text-align:left;">.paginate is similar to .find but it&#8217;s able to support the argument for :page =&gt; params[:page]</p>
<p style="text-align:left;">
<p style="text-align:left;">It is also possible to chain the pagination. Like using vote_fu&#8217;s tally,</p>
<p style="text-align:left;">@users = User.tally().paginate :page =&gt; params[:page], :per_page =&gt; 8, <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder =&gt; &#8220;name&#8221;</p>
<p style="text-align:left;">
<p style="text-align:left;">In the view, to have the 1,2,3,next etc&#8230;</p>
<p style="text-align:left;">this code needs to be added &lt;%= will_paginate @models %&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=13&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/06/09/pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding &#8220;Times Ago&#8221;</title>
		<link>http://tmonrails.wordpress.com/2009/05/29/adding-times-ago/</link>
		<comments>http://tmonrails.wordpress.com/2009/05/29/adding-times-ago/#comments</comments>
		<pubDate>Fri, 29 May 2009 05:48:14 +0000</pubDate>
		<dc:creator>TM Lee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[View]]></category>

		<guid isPermaLink="false">http://tmonrails.wordpress.com/?p=11</guid>
		<description><![CDATA[We will have to make use of the timestamp created_at data that was automatically assigned when the data is created. In the view of html.erb. &#60;%= time_ago_in_words(m.created_at) %&#62; ago<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=11&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We will have to make use of the timestamp created_at data that was automatically assigned when the data is created.</p>
<p>In the view of html.erb.</p>
<blockquote><p>&lt;%= time_ago_in_words(m.created_at) %&gt; ago</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tmonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tmonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tmonrails.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tmonrails.wordpress.com&amp;blog=7865731&amp;post=11&amp;subd=tmonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tmonrails.wordpress.com/2009/05/29/adding-times-ago/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e95c909c1ab4840209129540fb29fbef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tm89lee</media:title>
		</media:content>
	</item>
	</channel>
</rss>
