I am trying to get the hostname of the machine which a rails application is running on from the controller.
What would be the best way to do this taking into account
If you need the full domain path from protocol to port, try:
full_domain_path = request.env['rack.url_scheme'] + '://' + request.host_with_port