Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 789 Bytes

chaplin.helpers.md

File metadata and controls

36 lines (27 loc) · 789 Bytes
layout title module_path
default
Chaplin.helpers
src/chaplin/lib/helpers.coffee

Helpers that use Chaplin components (global event bus etc).

reverse(routeName[,...params])

Returns the url for a named route and any params.

For example, if you had declared this route

match '/users/:login/profile', 'users#show'
match('/users/:login/profile', 'users#show');

you may use:

Chaplin.helpers.reverse 'users#show', login: 'paulmillr'
# or
Chaplin.helpers.reverse 'users#show', ['paulmillr']
Chaplin.helpers.reverse('users#show', {login: 'paulmillr'});
// or
Chaplin.helpers.reverse('users#show', ['paulmillr']);

this will return '/users/paulmillr/profile'