Rails HTTP Status Code to Symbol Mapping

· 原发布于 blog.hackerpie.com

Sometimes you might need to set the HTTP response head with different status to specify the different handled results. You can do this in Rails by add a :status to a rails method such as #respond_with. Here list all the maps:

https://gist.github.com/ktkaushik/2405434

Addtionally, you can view all these on your local machine by installing the gem cheat, and see all status codes using command cheat status_codes.

All these informations come from internet, the codes file comes from ktkaushik’s gist and other information comes from Cody Fauser’s post

0
所有评论 0
Avatar
@hackerpie
成长,折腾,保持单纯
准则 博客 联系 反馈 © 2025 Geeknote