Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add documentation to ActionDispatch::Response

  • Loading branch information...
commit 56498b4b9e2e6092e131ba2b2319345a6712bf94 1 parent 03a3914
@MattStopa MattStopa authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 actionpack/lib/action_dispatch/http/response.rb
View
7 actionpack/lib/action_dispatch/http/response.rb
@@ -137,6 +137,7 @@ def committed?
@committed
end
+ # Allows you to set the HTTP status code
def status=(status)
@status = Rack::Utils.status_code(status)
end
@@ -155,6 +156,12 @@ def code
@status.to_s
end
+ # Returns the corresponding message for the current HTTP status code
+ # response.status = 200
+ # response.message # => "OK"
+ #
+ # response.status = 404
+ # response.message # => "Not Found"
def message
Rack::Utils::HTTP_STATUS_CODES[@status]
end
Please sign in to comment.
Something went wrong with that request. Please try again.