Ruby on Rails
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:

For testing purposes it might be useful to print out a table with the request.env information in it.

Place code like the following into a view to display the request.env Array.


<table> <tr> <th>key

value

<% for item in request.env >
<
= item0 %>

<%= item1 %>

<% end %>