<?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: Change Rails&#8217; layout via controller</title>
	<atom:link href="http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/</link>
	<description>class AllYourCode &#60; Us</description>
	<lastBuildDate>Mon, 28 Jun 2010 23:07:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: John</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-96</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sun, 23 Mar 2008 12:50:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-96</guid>
		<description>Will that work for RJS templates? i.e. format.js?</description>
		<content:encoded><![CDATA[<p>Will that work for RJS templates? i.e. format.js?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-65</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Tue, 04 Mar 2008 21:15:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-65</guid>
		<description>I had the same problem trying to figure that out :) Glad I could help!</description>
		<content:encoded><![CDATA[<p>I had the same problem trying to figure that out <img src='http://jonathanng.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Glad I could help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-64</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 04 Mar 2008 12:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-64</guid>
		<description>Sweet - thanks!
I had tried what you have in line #10 above, but it had *not* occurred to me to put what you have in line #2. Did both as you suggest and the app doesn&#039;t complain now. Thanks so much for stocking with this for me!</description>
		<content:encoded><![CDATA[<p>Sweet &#8211; thanks!<br />
I had tried what you have in line #10 above, but it had *not* occurred to me to put what you have in line #2. Did both as you suggest and the app doesn&#8217;t complain now. Thanks so much for stocking with this for me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-62</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Tue, 04 Mar 2008 00:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-62</guid>
		<description>Steve, this should make sense, if not, let me know.

&lt;pre lang=&quot;ruby&quot; line=&quot;1&quot;&gt;
class DashboardController &lt; ApplicationController
  layout &#039;primary&#039;

  def index
    @everything = Stuff.find(:all)
  end
  
  def show
    @something = Stuff.find(params[:id])
    render :layout =&gt; &quot;secondary&quot;
  end
  
end

&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Steve, this should make sense, if not, let me know.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> DashboardController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
  layout <span style="color:#996600;">'primary'</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> index
    <span style="color:#0066ff; font-weight:bold;">@everything</span> = Stuff.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> show
    <span style="color:#0066ff; font-weight:bold;">@something</span> = Stuff.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:id</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    render <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;secondary&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-59</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sat, 01 Mar 2008 02:57:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-59</guid>
		<description>Jonathan - thanks! I appreciate your help and interest. I&#039;m sorry, I don&#039;t follow which &quot;method&quot; you are suggesting I place that directive in. Assuming we are talking about the controller, I&#039;ve got the basic 2,0 RESTful controller with at present the basic seven methods. I want all except &quot;show&quot; to use a common layout, but I want &quot;show&quot; to use a different one. When I put anything that begins with &quot;render&quot; inside the show method I get an error informing me that too many redirects have been requested.</description>
		<content:encoded><![CDATA[<p>Jonathan &#8211; thanks! I appreciate your help and interest. I&#8217;m sorry, I don&#8217;t follow which &#8220;method&#8221; you are suggesting I place that directive in. Assuming we are talking about the controller, I&#8217;ve got the basic 2,0 RESTful controller with at present the basic seven methods. I want all except &#8220;show&#8221; to use a common layout, but I want &#8220;show&#8221; to use a different one. When I put anything that begins with &#8220;render&#8221; inside the show method I get an error informing me that too many redirects have been requested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-57</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Fri, 29 Feb 2008 18:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-57</guid>
		<description>Steve, try something like this inside your method:

&lt;pre lang=&quot;rails&quot; line=&quot;0&quot;&gt;
render :action =&gt; &quot;index&quot;, :layout =&gt; &quot;help&quot;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Steve, try something like this inside your method:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#5A0A0A; font-weight:bold;">render</span> <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;index&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;help&quot;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://jonathanng.com/ruby-on-rails/change-rails-layout-via-controller/comment-page-1/#comment-56</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 29 Feb 2008 17:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/ruby-on-rails/change-rails-layout-via-controller/#comment-56</guid>
		<description>I can&#039;t figure out how to get a specific controller method to use a different layout. Your example works at the top of the controller, but how do I get &quot;show&quot; to use a different layout than &quot;new&quot; does? &quot;render&quot; doesn&#039;t seem to work anymore.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t figure out how to get a specific controller method to use a different layout. Your example works at the top of the controller, but how do I get &#8220;show&#8221; to use a different layout than &#8220;new&#8221; does? &#8220;render&#8221; doesn&#8217;t seem to work anymore.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
