<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: My Five Favorite Things About Rails 3</title>
	<atom:link href="http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 12:12:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Electrician</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-59031</link>
		<dc:creator>Electrician</dc:creator>
		<pubDate>Sun, 09 Oct 2011 02:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-59031</guid>
		<description>As most of Rails developers, recently I’ve been through a process of 
unlearning all concepts of older versions of Rails and learning again 
the new ones of 3. But hey! I must admit that so far it’s been more 
pleasure than pain as things only get simpler and more natural than they
 used to be!

Here I’d like to talk about how simple it has become to 
integrate unobtrusive jQuery to a Rails app. Let’s use as an example a 
system of comments. I’ll create a simple app to create YouTube like 
comments:</description>
		<content:encoded><![CDATA[<p>As most of Rails developers, recently I’ve been through a process of<br />
unlearning all concepts of older versions of Rails and learning again<br />
the new ones of 3. But hey! I must admit that so far it’s been more<br />
pleasure than pain as things only get simpler and more natural than they<br />
 used to be!</p>
<p>Here I’d like to talk about how simple it has become to<br />
integrate unobtrusive jQuery to a Rails app. Let’s use as an example a<br />
system of comments. I’ll create a simple app to create YouTube like<br />
comments:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javix</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-46258</link>
		<dc:creator>Javix</dc:creator>
		<pubDate>Tue, 28 Sep 2010 14:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-46258</guid>
		<description>I used with previous Rails version (2.3.8) the flash like that to prevent last user deletion: 
[code] 
#users_controller.rb 
 
def destroy 
    @user = User.find(params[:id]) 
    begin 
      @user.destroy 
      flash[:notice] = &#039;User was successfully deleted.&#039; 
    rescue Exception =&gt; e 
      flash[:notice] = e.message 
    end 
    respond_to do &#124;format&#124; 
      format.html { redirect_to(users_url) } 
      format.xml  { head :ok } 
    end 
  end 
[/code] 
and in User model: 
[code] 
#user.rb 
def after_destroy 
    if User.count.zero? 
      raise &quot;Can&#039;t delete last user&quot; 
    end 
  end 
[/code] 
How to achieve the same functionality in Rails 3.0 (in User model I had to change &#039;after_destroy&#039; callback): 
[code] 
#user.rb in Rails 3.0 
after_destroy :check_user_for_destroy 
 
def check_user_for_destroy 
    if User.count.zero? 
      raise &quot;Can not delete the last user&quot; 
    end 
  end 
[/code] 
Thanks </description>
		<content:encoded><![CDATA[<p>I used with previous Rails version (2.3.8) the flash like that to prevent last user deletion:<br />
[code]<br />
#users_controller.rb </p>
<p>def destroy<br />
    @user = User.find(params[:id])<br />
    begin<br />
      @user.destroy<br />
      flash[:notice] = &#039;User was successfully deleted.&#039;<br />
    rescue Exception =&gt; e<br />
      flash[:notice] = e.message<br />
    end<br />
    respond_to do |format|<br />
      format.html { redirect_to(users_url) }<br />
      format.xml  { head :ok }<br />
    end<br />
  end<br />
[/code]<br />
and in User model:<br />
[code]<br />
#user.rb<br />
def after_destroy<br />
    if User.count.zero?<br />
      raise &quot;Can&#039;t delete last user&quot;<br />
    end<br />
  end<br />
[/code]<br />
How to achieve the same functionality in Rails 3.0 (in User model I had to change &#039;after_destroy&#039; callback):<br />
[code]<br />
#user.rb in Rails 3.0<br />
after_destroy :check_user_for_destroy </p>
<p>def check_user_for_destroy<br />
    if User.count.zero?<br />
      raise &quot;Can not delete the last user&quot;<br />
    end<br />
  end<br />
[/code]<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John F. Miller</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-43705</link>
		<dc:creator>John F. Miller</dc:creator>
		<pubDate>Sat, 21 Aug 2010 23:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-43705</guid>
		<description>Regarding the API in sec. 4:  Model needs to also implement a sane to_s method (I think I cannot find definitive documentation anywhere) the spits out the slug (e.g. record id) to use in the url. </description>
		<content:encoded><![CDATA[<p>Regarding the API in sec. 4:  Model needs to also implement a sane to_s method (I think I cannot find definitive documentation anywhere) the spits out the slug (e.g. record id) to use in the url.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-42914</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 29 Jun 2010 20:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-42914</guid>
		<description>Sorry no rights? </description>
		<content:encoded><![CDATA[<p>Sorry no rights?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: o learn</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-41358</link>
		<dc:creator>o learn</dc:creator>
		<pubDate>Wed, 10 Mar 2010 05:21:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-41358</guid>
		<description>The code on the article is not very good for reading. </description>
		<content:encoded><![CDATA[<p>The code on the article is not very good for reading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Viola</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-38038</link>
		<dc:creator>Diego Viola</dc:creator>
		<pubDate>Sun, 06 Dec 2009 09:53:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-38038</guid>
		<description>I&#039;m interested in the modularity, like using Sequel instead of ActiveRecord, etc. The Responder looks nice too. 
 
Can&#039;t wait for Rails 3. 
 </description>
		<content:encoded><![CDATA[<p>I&#039;m interested in the modularity, like using Sequel instead of ActiveRecord, etc. The Responder looks nice too. </p>
<p>Can&#039;t wait for Rails 3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jacques</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-23367</link>
		<dc:creator>jacques</dc:creator>
		<pubDate>Thu, 08 Oct 2009 12:46:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-23367</guid>
		<description>Yep, all you need is a Gemfile and you can run gem bundle in any directory. Don&#039;t even need a framework, can just require &quot;vendor/gems/environment&quot; and you&#039;re set! </description>
		<content:encoded><![CDATA[<p>Yep, all you need is a Gemfile and you can run gem bundle in any directory. Don&#039;t even need a framework, can just require &quot;vendor/gems/environment&quot; and you&#039;re set!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandip Ransing</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-19151</link>
		<dc:creator>Sandip Ransing</dc:creator>
		<pubDate>Thu, 24 Sep 2009 07:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-19151</guid>
		<description>Thanks for useful post as usual.  
I would like to see all other new stuffs that left in this post and will get released as a part of rails 2.3 
 
Thanks, 
Sandip R~ </description>
		<content:encoded><![CDATA[<p>Thanks for useful post as usual.<br />
I would like to see all other new stuffs that left in this post and will get released as a part of rails 2.3 </p>
<p>Thanks,<br />
Sandip R~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conrad Taylor</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-18143</link>
		<dc:creator>Conrad Taylor</dc:creator>
		<pubDate>Thu, 10 Sep 2009 22:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-18143</guid>
		<description>Hi, I&#039;m interested in implementing the API in (5) but I was wondering, what&#039;s the proper way to tell ActionPack about this new ORM and should this API be implemented as a module?  Anyway, examples would be greatly appreciated. 
 
Thanks in advance, 
 
-Conrad 
 </description>
		<content:encoded><![CDATA[<p>Hi, I&#039;m interested in implementing the API in (5) but I was wondering, what&#039;s the proper way to tell ActionPack about this new ORM and should this API be implemented as a module?  Anyway, examples would be greatly appreciated. </p>
<p>Thanks in advance, </p>
<p>-Conrad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sensei</title>
		<link>http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/comment-page-1/#comment-16325</link>
		<dc:creator>sensei</dc:creator>
		<pubDate>Wed, 02 Sep 2009 11:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=1969#comment-16325</guid>
		<description>Javascript validations? </description>
		<content:encoded><![CDATA[<p>Javascript validations?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

