<?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>Ruby breakfast &#187; RubyOnRails</title>
	<atom:link href="http://emilientaque.fr/category/rubyonrails/feed/" rel="self" type="application/rss+xml" />
	<link>http://emilientaque.fr</link>
	<description>Technical tricks from a freelance Ruby &#38; Rails developper living in Nantes, France.</description>
	<lastBuildDate>Thu, 28 Jan 2010 09:32:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tiny trick : lazy i18n-aware title helper</title>
		<link>http://emilientaque.fr/2010/01/tiny-trick-lazy-i18n-aware-title-helper/</link>
		<comments>http://emilientaque.fr/2010/01/tiny-trick-lazy-i18n-aware-title-helper/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:55:30 +0000</pubDate>
		<dc:creator>Emilien Taque</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://emilientaque.fr/?p=60</guid>
		<description><![CDATA[You&#8217;re probably already using a title helper, storing your page title into an instance variable in order to output it in the layout.
I&#8217;m using the following trick to use by default the &#8220;.title&#8221; i18n key of the current page, that&#8217;s useful only for static-title pages.
No more &#60;% title(&#8220;.title&#8221;) %&#62;, let&#8217;s simply &#60;% title %&#62; it [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re probably already using a <em>title</em> helper, storing your page title into an instance variable in order to output it in the layout.</p>
<p>I&#8217;m using the following trick to use by default the &#8220;.title&#8221; i18n key of the current page, that&#8217;s useful only for static-title pages.</p>
<script src="http://gist.github.com/281079.js"></script>
<p>No more <em>&lt;% title(&#8220;.title&#8221;) %&gt;</em>, let&#8217;s simply <em>&lt;% title %&gt;</em> it !</p>
]]></content:encoded>
			<wfw:commentRss>http://emilientaque.fr/2010/01/tiny-trick-lazy-i18n-aware-title-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with permalinks in Rails</title>
		<link>http://emilientaque.fr/2010/01/dealing-with-permalinks-in-rails/</link>
		<comments>http://emilientaque.fr/2010/01/dealing-with-permalinks-in-rails/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 00:29:25 +0000</pubDate>
		<dc:creator>Emilien Taque</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://emilientaque.fr/?p=47</guid>
		<description><![CDATA[When you want to improve your SEO karma, you have to play with your urls. You can use norman/friendly_id, but you can also do it yourself, it&#8217;s quite simple: just rewrite to_param method.
We can go further by creating a column for the permalink and using a hook to fill it:
On the controller side, it remains [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to improve your SEO karma, you have to play with your urls. You can use <a href="http://github.com/norman/friendly_id" target="_blank">norman/friendly_id</a>, but you can also do it yourself, it&#8217;s quite simple: just rewrite to_param method.</p>
<script src="http://gist.github.com/279682.js"></script>
<p>We can go further by creating a column for the permalink and using a hook to fill it:</p>
<script src="http://gist.github.com/279684.js"></script>
<p>On the controller side, it remains the same thanks to this Ruby behaviour:</p>
<script src="http://gist.github.com/279687.js"></script>
<p>More interesting,  we can avoid duplicate content by redirecting urls with a bad permalink:</p>
<script src="http://gist.github.com/279697.js"></script>
<h3><span style="color: #ff0000;">Update</span></h3>
<p>Thanks to <a href="http://henrik.nyh.se/2009/09/canonizing-pseudo-slugs-in-rails" target="_blank">Henryk Nye</a>, I&#8217;ve improved my :redirect_if_moved method (maybe should I rename it :redirect_if_better).</p>
<script src="http://gist.github.com/281033.js"></script>
<p>Direct quote:</p>
<blockquote><p>Using <code>:overwrite_params</code> will ensure any additional parameters are unchanged.</p></blockquote>
<p>Have SEO fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://emilientaque.fr/2010/01/dealing-with-permalinks-in-rails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>404 to the rescue</title>
		<link>http://emilientaque.fr/2009/12/404-to-the-rescue/</link>
		<comments>http://emilientaque.fr/2009/12/404-to-the-rescue/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 13:19:58 +0000</pubDate>
		<dc:creator>Emilien Taque</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://emilientaque.fr/?p=9</guid>
		<description><![CDATA[There are the &#8220;not found&#8221; related exceptions rescued by 404 in my rails apps:

(The Peugeot 404 by Pleuntje)
]]></description>
			<content:encoded><![CDATA[<p>There are the &#8220;not found&#8221; related exceptions rescued by 404 in my rails apps:</p>
<script src="http://gist.github.com/254897.js"></script><noscript><code class="gist"><pre><br />
rescue_from ActionController::RoutingError,<br />
ActionController::UnknownAction,<br />
ActiveRecord::RecordNotFound,<br />
ActionView::MissingTemplate,<br />
ActionController::MethodNotAllowed,<br />
WillPaginate::InvalidPage, :with =&gt; :route_not_found</p>
<p>protected</p>
<p># 404<br />
def route_not_found<br />
render :template =&gt; &#8216;welcome/404&#8242;, :status =&gt; :not_found<br />
end<br />
</pre></code></noscript>
<p><a href="http://www.flickr.com/photos/pleuntje/210792583/in/pool-peugeot404"><img class="alignnone" title="Peugeot 404 detail" src="http://farm1.static.flickr.com/64/210792583_b070f5b074.jpg" alt="" width="500" height="347" /></a></p>
<p style="text-align: center;">(The <a href="http://en.wikipedia.org/wiki/Peugeot_404" target="_blank">Peugeot 404</a> by <a href="http://www.flickr.com/photos/pleuntje/210792583/in/pool-peugeot404" target="_blank">Pleuntje</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://emilientaque.fr/2009/12/404-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
