Created
August 7, 2014 01:14
-
-
Save paulmolluzzo/559d44ce5e78226d702b to your computer and use it in GitHub Desktop.
URL Encoding Helper for Meteor
This file contains hidden or 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
UI.registerHelper('escapeURL', function(route, id) { | |
var path = Meteor.absoluteUrl() + Router.routes[route].path({_id: id}).substring(1); | |
return encodeURIComponent(path); | |
}); |
This file contains hidden or 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
<template name="whatever"> | |
{{#each thing}} | |
<a href="{{escapeURL 'routeName' this._id }}">Link to Escaped URL</a> | |
{{/each}} | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment