[Nitro] Trapping unhandled URLs

James Britt james_b at neurogami.com
Tue Nov 8 00:09:55 EST 2005


James Britt wrote:
> I'm getting ready to deploy a public Nitro app, and would like it to be 
> as robust as possible.  Right now, if one calls int a bogus URL, it 
> displays an error, like this:
> 
> 
> Path: /sddsf
> undefined method `sddsf_action' for #
> Click here to reload.
> Click here to go to the referrer or the home page.
> 
> I'd like to ensure that URLs that do not map to some sensible action are 
>   simply rendered as a call to the main index page, but do not know how 
> to do this.
> 
> Any suggestions?

Here's what I figured out:

   def error
      render  'index'
   end

in the controller raising the exception


Thanks,

James



More information about the Nitro-general mailing list