<?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>daydreaming &#187; ruby</title>
	<atom:link href="http://n79.org/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://n79.org</link>
	<description></description>
	<lastBuildDate>Sun, 22 Apr 2012 17:29:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Overrides in Camping</title>
		<link>http://n79.org/2008/03/05/overrides-in-camping/</link>
		<comments>http://n79.org/2008/03/05/overrides-in-camping/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 08:18:06 +0000</pubDate>
		<dc:creator>nikhilb</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://n79.org/2008/03/05/overrides-in-camping/</guid>
		<description><![CDATA[If you want to add a call to all the controllers in your Camping miroframework app you can use before or after overrides. These are similar to the before_filter in Rails. Remember to return the superclass or Camping will throw a &#8220;Read error: #&#60;NoMethodError: undefined method `status&#8217; for nil:NilClass&#62;&#8221; because it can&#8217;t call back into [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to add a call to all the controllers in your  <a href="http://code.whytheluckystiff.net/camping/" title="Camping Microframework" target="_blank">Camping miroframework</a> app you can use <a href="http://code.whytheluckystiff.net/camping/wiki/BeforeAndAfterOverrides" title="Before or After Override for camping" target="_blank">before or after overrides</a>. These are similar to the <em>before_filter</em> in Rails.</p>
<p>Remember to return the superclass or Camping will throw a <em>&#8220;Read error: #&lt;NoMethodError: undefined method `status&#8217; for nil:NilClass&gt;</em>&#8221; because it can&#8217;t call back into the returned controller. A <font color="#ff0000">modification</font> of the above linked wiki page example illustrates -</p>
<pre class="brush: ruby; title: ; notranslate">
Camping.goes :YourApp

module YourSession
  def service(*a)
    @session = YourApp::Session.new
    s = super(*a)
    @session.close
    #return s from above after completing
    s
  end
end

module YourApp
  include YourSession
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://n79.org/2008/03/05/overrides-in-camping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.380 seconds -->

