route method #90

Closed
ccorcos opened this Issue Aug 29, 2013 · 2 comments

2 participants

@ccorcos

Is it possible to have a route that doesnt render any template and just does something?

This is the functionality I am looking for:

this.route( {
    path: '/something/:info1/:info2',
    method: function() { 
        // do something with this.params.info1 and this.params.info2
        Router.go('elsewhere');
    },
});

If not, is there a way of achieving this functionality? I think it would be useful...

Thanks,

Chet

@cmather

Option 1: Provide a direct handler

this.route({
  path: '/something/:info1/:info2'
}, function () { /* ... */ );

Option 2: Specify an action on a controller

this.route({
  path: '...',
  action: 'someMethod',
  controller: 'SomeController'
});
@cmather cmather closed this Aug 30, 2013
@ccorcos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment