Answer the question
In order to leave comments, you need to log in
How to display 500 errors in rails?
Everything worked fine and then at one point the application crashes. I want to find out why the application crashes, but there is not enough knowledge in rails (((
In the main controller, errors are processed like this
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: lambda { |exception| render_error 500, exception }
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
end
def render_error(status, exception)
@is_in_error = true
respond_to do |format|
format.html { render template: "errors/error_#{status}", layout: 'layouts/application', status: status , exception: exception }
format.all { render nothing: true, status: status }
end
end
%p.wow='УПС... 500'
.text
%p='Xьюстон у нас потери'
%p.support
Служба поддержки -
=link_to support_url, support_path , exception.message
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question