Rails server environment info can be accessed from your views with the following syntax

request.env[“NAME_OF_VARIABLE”]

for example request.env[“REQUEST_ADDR”] should return the referring address

From the Rails wiki http://wiki.rubyonrails.org/rails/pages/VariablesInRequestEnv

request.env is a Ruby Array that contains information about a visiting user’s and server environments.

This is similar to the php variable $_SERVER.

request.env is accessible on all pages hosted in a ruby on rails site. The Array contains the following key/value pairs:

 
request_variables_request.env.txt · Last modified: 2008/04/21 16:34 by jim
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki