'Generates a path (aka a \'relative URL\', a URL minus the host, scheme,
and port) for a :term:`resource`.
This function accepts the same argument as
:meth:`pyramid.request.Request.resource_url` and performs the same
duty.  It just omits the host, port, and scheme information in the
return value; only the script_name, path, query parameters, and
anchor data are present in the returned string.
.. note::
Calling ``request.resource_path(resource)`` is the same as calling
``request.resource_path(resource, app_url=request.script_name)``.
:meth:`pyramid.request.Request.resource_path` is, in fact,
implemented in terms of
:meth:`pyramid.request.Request.resource_url` in just this way. As
a result, any ``app_url`` passed within the ``**kw`` values to
``route_path`` will be ignored.  ``scheme``, ``host``, and
``port`` are also ignored.'

def resource_path(self, resource, *elements, **kw):

    kw['app_url'] = self.script_name
    return self.resource_url(resource, *elements, **kw)
