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
Raw Normal View History

2008-10-01 02:19:35 -04:00
class Exceptions < Application
# 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