Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Forked from hassox/exceptions.rb
Created February 16, 2009 04:38
Show Gist options
  • Save TheNicholasNick/65010 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/65010 to your computer and use it in GitHub Desktop.
class Exceptions < Merb::Controller
# handle NotFound exceptions (404)
def not_found
render :format => :html
end
# handle NotAcceptable exceptions (406)
def not_acceptable
render :format => :html
end
def set_referrer
render :format => :html
end
def unauthenticated
provides :xml, :js, :json, :yaml
render, :layout => :unauthenticated # still renders application layout
end # unauthenticated
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment