Ruby on Rails
PhpVariables (Version #1)

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)

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

See also:


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

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)

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

See also:


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