I am making rails app and I need to get just hostname of my URL from my one of Rails controllers.
If my URL is
You can use
request.host to get exact your URL which you want.
And you can use
request.port to get your port from url