<div>404 on 1.5:<br><div>module App::Controllers</div><div>  class NotFound</div><div>    def get(path)</div><div>      &quot;Do something with path&quot;</div><div>    end</div><div>  end</div><div>end</div><div><br></div>

<div>404 on 1.9/2.0:</div><div>module App</div><div>  def r404(path)</div><div>    &quot;Do something with path&quot;</div><div>  end</div><div>end</div><div><br></div><div>There appears to be two solutions: Call ActiveRecord::Base.verify_active_connections! before every request (I think this is what Rails does by default):</div>

<div><br></div><div><div>module VerifyConnection</div><div>  def service(*args)</div><div>    ActiveRecord::Base.verify_active_connections!</div><div>  ensure</div><div>    return super</div><div>  end</div><div>end</div>

<div><br></div><div>module App</div><div>  include VerifyConnection</div><div>end</div><div><br></div><div>Or, pass reconnect =&gt; true to establish_connection.</div><div><br></div><div>I&#39;m not quite sure what&#39;s best…</div>

</div></div><div><br></div><div>// Magnus Holm<br>
<br><br><div class="gmail_quote">On Fri, Feb 19, 2010 at 20:59, David Susco <span dir="ltr">&lt;<a href="mailto:dsusco@gmail.com">dsusco@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I have a few camping projects that are about to go into production in<br>
a few weeks, just picking your brains to see if I can add some<br>
robustness.<br>
<br>
What&#39;s the best way to catch any &quot;Camping Problem! /XXX not found&quot;<br>
errors that a user might see if they start typing URLs themselves?<br>
Ideally I&#39;d just like to redirect them all to some general index<br>
controller.<br>
<br>
I&#39;m using MySQL for my database. I&#39;m getting a few &quot;MySQL server has<br>
gone away&quot; error messages every now and then. I did some searching and<br>
found if &quot;reconnect: true&quot; is in the hash I send to<br>
establish_connection that I should be all set. Can anyone confirm?<br>
Also, any other MySQL connection &quot;best practices&quot; that I should be<br>
following?<br>
<font color="#888888"><br>
--<br>
Dave<br>
_______________________________________________<br>
Camping-list mailing list<br>
<a href="mailto:Camping-list@rubyforge.org">Camping-list@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/camping-list" target="_blank">http://rubyforge.org/mailman/listinfo/camping-list</a><br>
</font></blockquote></div><br></div>