RingoJS

Module helpers

A collection of helper functions that makes working with Stick middleware easier.

Functions


linkTo (app, bindings, text)

Return a link to an action configured using the route middleware.

The link's URL is generated from the bindings argument as described for the urlFor helper.

Parameters

object|string app

the application to link to

object bindings

an object containing the bindings for the target URL.

string text

the link text.


redirectTo (app, bindings)

Create a response that redirects the client to a different URL.

Parameters

string|object app

either the URL as string or an app to be passed to urlFor

bindings bindings

to pass to urlFor if first argument is an app.

Returns

object

a JSGI response that will redirect the client to the specified target


resolveApp (app)

Parameters

null app

urlFor (app, bindings)

Parameters

null app
null bindings