Environment variables

Can anyone help me to find out the syntax to access the environment
variable that has the site domain? Maybe HTTP_HOST?
i have tried to find documentation on how to access such a variable,
but with no luck. Can someone help me (even if it is just pointing me
in the right direction for searching)?
Thanks,
Tolstoy

The three biggies are

  • params
  • response
  • session

I think you will find HTTP stuff in response (just do a ‘puts
response.inspect’)…

On 10/13/07, nigel.bris [email protected] wrote:

The three biggies are

  • params
  • response
  • session

I think you will find HTTP stuff in response (just do a ‘puts
response.inspect’)…

This is a request thing, isn’t it?

I’d look in request.env, and possibly ENV.

I was able to get the effect that I was after by using the following
in an rhtml file:
http://<%= request.server_name %>:<%= request.server_port %>/
This seems like a hack though. By inspecting <%= debug(request.env) %>
I can see that “HTTP_HOST” has the info that i am after, I just
haven’t found a way to access that variable in an rhtml file.