<?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: Using helpers in a controller: with_helpers</title>
	<atom:link href="http://blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers/</link>
	<description>The guys behind LivingSocial</description>
	<lastBuildDate>Fri, 12 Mar 2010 02:58:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Darragh Curran</title>
		<link>http://blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers/comment-page-1/#comment-180</link>
		<dc:creator>Darragh Curran</dc:creator>
		<pubDate>Thu, 07 Aug 2008 13:49:00 +0000</pubDate>
		<guid isPermaLink="false">blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers#comment-180</guid>
		<description>Hey - looks neat.

I do this to achieve something similar. (think i first came across it here - http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/)


class Helper
  include Singleton
  include ActionView::Helpers::UrlHelper
end

class ApplicationController &lt; ActionController::Base
  def helpers
    Helper.instance
  end
end



class MyController &lt; ApplicationController
  def my_action
    @person = Person.find(params[:id])
    render :text =&gt; helpers.link_to(@person.full_name, person_path(@person))
  end
end</description>
		<content:encoded><![CDATA[<p>Hey &#8211; looks neat.</p>
<p>I do this to achieve something similar. (think i first came across it here &#8211; <a href="http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/)" rel="nofollow">http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/)</a></p>
<p>class Helper<br />
  include Singleton<br />
  include ActionView::Helpers::UrlHelper<br />
end</p>
<p>class ApplicationController &lt; ActionController::Base<br />
  def helpers<br />
    Helper.instance<br />
  end<br />
end</p>
<p>class MyController &lt; ApplicationController<br />
  def my_action<br />
    @person = Person.find(params[:id])<br />
    render :text =&gt; helpers.link_to(@person.full_name, person_path(@person))<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Manges</title>
		<link>http://blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers/comment-page-1/#comment-181</link>
		<dc:creator>Dan Manges</dc:creator>
		<pubDate>Thu, 07 Aug 2008 13:49:00 +0000</pubDate>
		<guid isPermaLink="false">blog.hungrymachine.com/2008/08/07/using-helpers-in-a-controller-with_helpers#comment-181</guid>
		<description>For this particular example, you could use render with :inline.

  render :inline =&gt; &quot;&lt;%= link_to(@person.full_name, person_path(@person)) %&gt;&quot;</description>
		<content:encoded><![CDATA[<p>For this particular example, you could use render with :inline.</p>
<p>  render :inline =&gt; &quot;&lt;%= link_to(@person.full_name, person_path(@person)) %&gt;&quot;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
