How can I get the local hostname in Rails? Or Ruby for that matter.
Thanks in advance.
How can I get the local hostname in Rails? Or Ruby for that matter.
Thanks in advance.
Joe S. wrote:
How can I get the local hostname in Rails? Or Ruby for that matter.
Cheat:
me = hostname
Note the backticks ``
If that don’t work, cheat harder.
–
Phlip
http://c2.com/cgi/wiki?ZeekLand ← NOT a blog!!
On Mon, 18 Dec 2006 16:59:41 +0100
Joe S. [email protected] wrote:
How can I get the local hostname in Rails? Or Ruby for that matter.
Thanks in advance.
In Rails, there is request.host or request.host_with_port that you can
use in your controllers.
or better yet
in rails:
ENV[“HOSTNAME”]
Chris
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs