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

21 lines
390 B
Ruby

class Exceptions < Application
# handle NotFound exceptions (404)
def not_found
do_your_render_thing
end
# 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
render_and_notify :format => :html
end
end
end