For the whole application:
# ApplicationController before_filter :return_unavailable_status private def return_unavailable_status render :nothing => true, :status => :service_unavailable end
If you want to create a custom error page, you can do the following:
render 'custom_unavailable_page', :status => :service_unavailable
If you do not want to use it for certain controllers:
iwasrobbed Jan 17 '12 at 6:13 2012-01-17 06:13
source share