Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因为有很多不是状态码的数字。我可以创建自己的状态码吗(例如:444)。我听说在部署在 phusion 乘客中的 Rails 应用程序中渲染我们自己的状态代码会给你 500?是不是真的。如果是这样,我们如何为业务逻辑目的创建自己的状态代码?
如果您想要一个特定的状态代码,您只需添加到控制器操作中就是
render :status => 444
返回的状态代码应该在 Apache Web Server 接受的状态代码列表中。