layout | title | module_path |
---|---|---|
default |
Chaplin.helpers |
src/chaplin/lib/helpers.coffee |
Helpers that use Chaplin components (global event bus etc).
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'