views:

20

answers:

2

Is there an elegant way to check which port you deployed a ruby on rails application using mongrel? I could not find a directive (i.e. such as #{RAILS_ROOT} which contains the root directory of the application) that I can use to perform a check. I need this to do a check since I am deploying the same application on different ports and I need the app to do different things according to the port that is being accessed.

Any help would be appreciated,

Thanks

A: 

Nvm, I've figured it out, I could use the @request to check the request parameters.

Thanks either way :)

john chan
+1  A: 

Where do you need this? In the controller action you can do the following to get the host/port:

request.host
request.port
KandadaBoggu