<?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: Nested Layouts in Rails</title>
	<atom:link href="http://www.cs8.my/nested-layouts-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cs8.my/nested-layouts-in-rails/</link>
	<description>Rapid Web Applications Done The Right Way!</description>
	<lastBuildDate>Wed, 10 Mar 2010 04:38:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Vered</title>
		<link>http://www.cs8.my/nested-layouts-in-rails/comment-page-1/#comment-28</link>
		<dc:creator>Vered</dc:creator>
		<pubDate>Tue, 07 Oct 2008 10:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://webtest.consoci8.com/?p=131#comment-28</guid>
		<description>Just wanted to say THANKS for your great solution - exactly what I needed.&lt;br /&gt;Works perfect!</description>
		<content:encoded><![CDATA[<p>Just wanted to say THANKS for your great solution &#8211; exactly what I needed.<br />Works perfect!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Parkes</title>
		<link>http://www.cs8.my/nested-layouts-in-rails/comment-page-1/#comment-27</link>
		<dc:creator>Steven Parkes</dc:creator>
		<pubDate>Thu, 11 Sep 2008 20:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://webtest.consoci8.com/?p=131#comment-27</guid>
		<description>I didn&#039;t need a new nested layout for every controller, just a few. Well, one to start. Simply wrapping the render :partial with a block and catching the MissingTemplate, where you drop back to yield, (seems to) work great:&lt;br /&gt;&lt;br /&gt;&lt;%= begin; render :partial =&gt; &quot;layouts/#{controller.controller_name}&quot;; rescue ActionView::MissingTemplate; yield; end %&gt;</description>
		<content:encoded><![CDATA[<p>I didn&#39;t need a new nested layout for every controller, just a few. Well, one to start. Simply wrapping the render :partial with a block and catching the MissingTemplate, where you drop back to yield, (seems to) work great:</p>
<p>&lt;%= begin; render :partial =&gt; &quot;layouts/#{controller.controller_name}&quot;; rescue ActionView::MissingTemplate; yield; end %&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weyus</title>
		<link>http://www.cs8.my/nested-layouts-in-rails/comment-page-1/#comment-26</link>
		<dc:creator>Weyus</dc:creator>
		<pubDate>Fri, 22 Aug 2008 22:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://webtest.consoci8.com/?p=131#comment-26</guid>
		<description>You can take this a step further.&lt;br /&gt;&lt;br /&gt;If you want to mix and match your &quot;layouts&quot; (which are really just partials, let&#039;s face it) across arbitrary controller/action pairs, you can just define a special variable, say @inner_layout.&lt;br /&gt;&lt;br /&gt;And then in each action that you want to use the inner layout, you just define it.&lt;br /&gt;&lt;br /&gt;So in your application.html.erb:&lt;br /&gt;&lt;br /&gt;&lt;%= @inner_layout ? render(:partial =&gt; &quot;layouts/#{@inner_layout}&quot;) : yield %&gt;&lt;br /&gt;&lt;br /&gt;If there&#039;s an inner &quot;layout&quot; (partial) then render it (assuming that it will yield), and if there isn&#039;t one, just go ahead and yield.&lt;br /&gt;&lt;br /&gt;And then in the appropriate action(s): &lt;br /&gt;&lt;br /&gt;@inner_layout = &#039;some_inner_layout_filename&#039;.&lt;br /&gt;&lt;br /&gt;Although the variable thing is a bit of a drag, you could take this as far as you want.</description>
		<content:encoded><![CDATA[<p>You can take this a step further.</p>
<p>If you want to mix and match your &quot;layouts&quot; (which are really just partials, let&#39;s face it) across arbitrary controller/action pairs, you can just define a special variable, say @inner_layout.</p>
<p>And then in each action that you want to use the inner layout, you just define it.</p>
<p>So in your application.html.erb:</p>
<p>&lt;%= @inner_layout ? render(:partial =&gt; &quot;layouts/#{@inner_layout}&quot;) : yield %&gt;</p>
<p>If there&#39;s an inner &quot;layout&quot; (partial) then render it (assuming that it will yield), and if there isn&#39;t one, just go ahead and yield.</p>
<p>And then in the appropriate action(s): </p>
<p>@inner_layout = &#39;some_inner_layout_filename&#39;.</p>
<p>Although the variable thing is a bit of a drag, you could take this as far as you want.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
