I would like to generate a URL to a resource and show it to the User. I found the link-to but I don't want the whole <a>
element but only the URL.
Something like:
{{#url-to 'photos.show' photo}}
I would like to generate a URL to a resource and show it to the User. I found the link-to but I don't want the whole <a>
element but only the URL.
Something like:
{{#url-to 'photos.show' photo}}
I am not sure what Emberjs version you are using but in any case this may work for you. I haven't try my self but probably will help you.
{{#url-to 'photos.show' photo}}
Ember.Handlebars.registerHelper('url-to', function() {
return Ember.Handlebars.helpers['link-to'].apply(this, args);
});
Check this tutorial which goes more in details. Also you can search for how to create blocs helpers in emebrjs.
there is addon which adds such helper {{href-to}}
have a look https://github.com/intercom/ember-href-to