This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
binaryattraction/app/controllers/exceptions.rb

23 lines
440 B
Ruby
Raw Permalink Normal View History

2008-10-01 02:19:35 -04:00
class Exceptions < Application
2008-10-17 04:13:45 -04:00
include MerbExceptions::ControllerExtensions
2008-10-01 02:19:35 -04:00
# handle NotFound exceptions (404)
def not_found
do_your_render_thing
2008-10-01 02:19:35 -04:00
end
2008-10-17 03:51:13 -04:00
2008-10-01 02:19:35 -04:00
# handle NotAcceptable exceptions (406)
def not_acceptable
do_your_render_thing
end
private
def do_your_render_thing
if request.xhr?
render :format => :html, :layout => false
else
2008-10-17 03:51:13 -04:00
render_and_notify :format => :html
end
2008-10-01 02:19:35 -04:00
end
end