Ruby on Rails
PhpVariables

Predefined Variables

$_SERVER

’REQUEST_URI’
The URI which was given in order to access this page; for instance, ’/index.html’.

PHP:


// print the current request uri
<?= $_SERVER['REQUEST_URI']; ?>


Ruby equiv (actually ERB)

# same thing, only in ruby
<%= request.request_uri %>

Additionally:


<%= request.path_parameters['controller'] %><br />
<%= request.path_parameters['action'] %>

In the RoR docs, see ActionController::AbstractRequest