Last active
December 17, 2015 15:39
-
-
Save ilovett/5632929 to your computer and use it in GitHub Desktop.
Give multiple arguments to your linkTo function in Ember.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var linkTo = Ember.Handlebars.helpers.linkTo; | |
Ember.Handlebars.registerHelper('linkToContext', function() { | |
linkTo.apply(this, arguments); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="/grandparent/23/parent/35/child/32/index">link</a></li> | |
<li><a href="/grandparent/565/parent/567/child/554/index">link</a></li> | |
<li><a href="/grandparent/523/parent/123/child/99/index">link</a></li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.Router.map(function() { | |
this.resource('grandParent', { 'path' : '/grandparent/:grand_parent_id' }, function() { | |
this.resource('parent', { 'path' : '/parent/:parent_id' }, function() { | |
this.resource('child', { 'path' : '/child/:child_id' }); | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment