if you just did that to get the users hostname, you can use:

request.host_with_port  

within the controller.