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

<channel>
	<title>Khaled alHabache's official blog &#187; Merb + RoR3</title>
	<atom:link href="http://www.khelll.com/blog/tag/merb-ror3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.khelll.com/blog</link>
	<description>What web development means....</description>
	<lastBuildDate>Tue, 16 Mar 2010 23:21:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What i liked most about rails 2.2</title>
		<link>http://www.khelll.com/blog/merb-ror3/what-i-liked-most-about-rails-22/</link>
		<comments>http://www.khelll.com/blog/merb-ror3/what-i-liked-most-about-rails-22/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 12:23:09 +0000</pubDate>
		<dc:creator>khelll</dc:creator>
				<category><![CDATA[Merb + RoR3]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[rails 2.2]]></category>

		<guid isPermaLink="false">http://www.khelll.com/blog/?p=88</guid>
		<description><![CDATA[Well, finally it&#8217;s there, many important improvements were added to rails 2.2, and yet new things are on the way, you can check this blog post  to check what&#8217;s new, while i&#8217;m gonna list here what i really liked about the new version of rails 2.2:
Thread safe
If you really don&#8217;t know what it means, [...]]]></description>
			<content:encoded><![CDATA[<p>Well, finally it&#8217;s there, many important improvements were added to rails 2.2, and yet new things are on the way, you can check <a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">this blog post </a> to check what&#8217;s new, while i&#8217;m gonna list here what i really liked about the new version of rails 2.2:</p>
<h2>Thread safe</h2>
<p>If you really don&#8217;t know what it means, then most probably you want to check <a title="Q/A: What Thread-safe Rails Means" href="http://blog.headius.com/2008/08/qa-what-thread-safe-rails-means.html">this post</a> by Charles Nutter, however in short terms: threaded rails with a native threaded implementation of ruby (<a title="jruby project" href="http://jruby.codehaus.org/">jruby</a> in our case) will save your memory , make your app more scalable, and most importantly it will make the app deployment very easy, specially when <a href="http://glassfishgem.rubyforge.org/">glassfish gem</a> or even with <a title="jetty rails" href="http://jetty-rails.rubyforge.org/">jetty-rails gem</a> is used.</p>
<p>And you Just have to make sure your app is thread safe, follow <a title="thread safty" href="http://m.onkey.org/2008/10/23/thread-safety-for-your-rails">this post</a> by Pratik Naik.</p>
<h2>Well documented</h2>
<p>So many people complained about this point before, but this a fact is from past now <img src='http://www.khelll.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , just fire your terminal , go to ur app path, and run :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">rake doc:guides</pre></div></div>

<p>This will create doc/guides in your project root , with a comprehensive rails guide to learn from.</p>
<h2>Internationalization or I18n</h2>
<p>A support for i18n is there now, so  you don&#8217;t have to install any extra gem or plugin, a<a href="http://i18n-demo.phusion.nl/"> comprehensive demo</a> is put there, <em>just be aware that you don&#8217;t need to install the plugin when following the demo, cause it&#8217;s already there in rails 2.2 .</em></p>
<p>Also check the <a title="rails internationalization i18n" href="http://railscasts.com/episodes/138-i18n">I18n screencast</a> by Ryan Bates.</p>
<h2>Performance + JRuby compatibility<br />
</h2>
<ul>
<li>Connection pooling is added in this version of rails , which will save the time of opening(open connection with the db server +authentication) and closing the connection for each http request, so now a pool of connections will be used to serve incomming http requests, instead of opening a new connection for each request.</li>
</ul>
<ul>
<li>There were efforts to enhance the erb system , which will affect the rendering process time.</li>
</ul>
<ul>
<li>Rails 2.2 is fully compatible with <a title="jruby project" href="http://jruby.codehaus.org/">JRuby</a> which is the fastest ruby implementation at the current moment, and that will give you better performance when JRuby is used ,specially that the JRuby team is continually and actively(a release every 3-4 weeks) working on optimizing the overall performance and for rails usage as well.</li>
<li><em>Memoization</em> term was introduced to cache values, check <a href="http://railscasts.com/episodes/137-memoization">this screencast</a> by Ryan Bates.</li>
<li>ETags and saving your server the hassle : if u don&#8217;t know about ETags then it&#8217;s time for that , check <a title="rails etags" href="http://ryandaigle.com/articles/2008/10/25/what-s-new-in-edge-rails-even-better-conditional-get-support">this post</a> by  Ryan Daigle.What matters here is that the new support from rails to ETags  will give you 2 enhancements :
<ol>
<li>Frontend enhancement: the client browser will use it&#8217;s cache to render the needed data and thus won&#8217;t need to issue a new request to your server to bring the data, thus a faster rendering on client side.</li>
<li>Backend enhancement: your ror servers won&#8217;t need to handle some logic to respond back to your client browser requests, thus free the processor to handle other logic.</li>
</ol>
</li>
<li>Template views will be cached now for production mode.</li>
</ul>
<h2>Caching actions without their layouts </h2>
<p>Now it&#8217;s possible to cache an action without it&#8217;s corresponding layout:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> HomepageController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
  <span style="color:#008000; font-style:italic;"># Just pass the param layout with false value</span>
  caches_action <span style="color:#ff3333; font-weight:bold;">:feedback</span>, <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
  ...
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This is really cool, cause in many cases our layout will contain some info related to user status in the website.</p>
<h2>More additions might be very interseting for you</h2>
<p>As for me, those enhancements and additions listed above , where the most benifitical for my work, other things might attract your attention, for more information about what&#8217;s new, i strongly urge you to look at <a title="Ruby on Rails 2.2 PDF" href="http://envycasts.com/products/ruby-on-rails-22-pdf">Ruby on Rails 2.2 PDF</a> by By Carlos Brando.<a title="Ruby on Rails 2.2 PDF" href="http://envycasts.com/products/ruby-on-rails-22-pdf"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.khelll.com/blog/merb-ror3/what-i-liked-most-about-rails-22/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
