<?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: Rails Tip: Use Polymorphism to Extend your Controllers at Runtime</title>
	<atom:link href="http://blog.mattwynne.net/2009/07/11/rails-tip-use-polymorphism-to-extend-your-controllers-at-runtime/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mattwynne.net/2009/07/11/rails-tip-use-polymorphism-to-extend-your-controllers-at-runtime/</link>
	<description>Matt Wynne taking it one tea at a time</description>
	<lastBuildDate>Fri, 27 Jan 2012 08:31:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Richie Vos</title>
		<link>http://blog.mattwynne.net/2009/07/11/rails-tip-use-polymorphism-to-extend-your-controllers-at-runtime/comment-page-1/#comment-762</link>
		<dc:creator>Richie Vos</dc:creator>
		<pubDate>Mon, 31 Aug 2009 21:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mattwynne.net/2009/07/11/rails-tip-use-polymorphism-to-extend-your-controllers-at-runtime/#comment-762</guid>
		<description>&lt;p&gt;Very interesting approach to this problem. I&#039;m dealing with a similar situation where I want to send different forms of xml to different clients and I was thinking about:&lt;/p&gt;

&lt;pre&gt;@things.to_xml(:api =&gt; &#039;123&#039;)&lt;/pre&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;pre&gt;@things = blah
if x
  render &#039;api1&#039;
elsif y
  render &#039;api2&#039;
else
  render &#039;api3&#039;
end&lt;/pre&gt;

&lt;p&gt;but your approach feels cleaner, though for simplicity I might just do something like&lt;/p&gt;

&lt;pre&gt;before_filter :determine_api

def determine_api
  @template = &#039;xyz&#039;
end
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Very interesting approach to this problem. I&#8217;m dealing with a similar situation where I want to send different forms of xml to different clients and I was thinking about:</p>

<pre>@things.to_xml(:api =&gt; '123')</pre>

<p>OR</p>

<pre>@things = blah
if x
  render 'api1'
elsif y
  render 'api2'
else
  render 'api3'
end</pre>

<p>but your approach feels cleaner, though for simplicity I might just do something like</p>

<pre>before_filter :determine_api

def determine_api
  @template = 'xyz'
end
</pre>]]></content:encoded>
	</item>
</channel>
</rss>

