简体   繁体   English

隐藏生产中的Rails错误

[英]Hide Rails Errors in production

How can i hide application errors in production mode and stop hem from showing to the users? 如何在生产模式下隐藏应用程序错误并阻止下摆显示给用户?

I want errors like this one not to show; 我希望这样的错误不显示;

can't convert Symbol into Integer

5:   <%= f.hidden_field :reset_password_token %>
6:   <%= f.input :password, autofocus: true, placeholder: "Password" %>
7:   <%= f.input :password_confirmation, label: false, placeholder: "Confirm Password" %>
8:   <%= f.input :submit , "Change Password" %>
9: <% end %>
10: 
11: <%= render "devise/shared/links" %>

In general you can define rescue_from statements in your application controller to rescue from exceptions and render error pages. 通常,您可以在应用程序控制器中定义rescue_from语句,以从异常中恢复并呈现错误页面。 This post gives an example. 这篇文章给出了一个例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM