Alive Developer
Alive Developer

Reputation: 1022

ember.js: giving a format to urls in link_to

I'm a newbie in ember, and i can't find anywhere where i can append a format to my links.

I have to show a pdf coming from my server, and in rails i would do it in this way:

<%= link_to "Print", document, format: pdf %>

asssuming that my server is actually responding at documents/:id.pdf, how can i build this link in ember, when i'm inside a cycle of this type?

{{#each document in controller}}
  ...print document link here...
{{/each}}

thanks,
Marco

Upvotes: 0

Views: 700

Answers (1)

zeppelin
zeppelin

Reputation: 1134

Ember's {{linkTo}} is for internal links.

If you want to link to an external resource, you should either user {{bindAttr}} on an <a> tag, or write a custom Handlebars helper.

Upvotes: 1

Related Questions