Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move response body to a private method

This is done to improve clarity of the code. 
  • Loading branch information...
commit 59df77733964d43190683aab21b4c226a36b8d0f 1 parent c81dc8e
@rShetty authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_controller/metal/redirecting.rb
View
6 actionpack/lib/action_controller/metal/redirecting.rb
@@ -68,7 +68,7 @@ def redirect_to(options = {}, response_status = {}) #:doc:
self.status = _extract_redirect_to_status(options, response_status)
self.location = _compute_redirect_to_location(options)
- self.response_body = "<html><body>You are being <a href=\"#{ERB::Util.h(location)}\">redirected</a>.</body></html>"
+ self.response_body = _show_response_body
end
private
@@ -100,5 +100,9 @@ def _compute_redirect_to_location(options)
url_for(options)
end.delete("\0\r\n")
end
+
+ def _show_response_body
+ "<html><body>You are being <a href=\"#{ERB::Util.h(location)}\">redirected</a>.</body></html>"
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.