# Bind to a Server Generated Link

**URL:** <https://discuss.emberjs.com/t/bind-to-a-server-generated-link/5789>\
**Category:** Uncategorized\
**Created:** [June 27, 2014, 11:41pm UTC](https://discuss.emberjs.com/t/bind-to-a-server-generated-link/5789 "2014-06-27T23:41:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![recipher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/recipher/32/9205_2.png) [@recipher](https://discuss.emberjs.com/u/recipher)\
**Post date:** [June 27, 2014, 11:41pm UTC](https://discuss.emberjs.com/t/bind-to-a-server-generated-link/5789/1 "2014-06-27T23:41:54Z")

</div>

Hi. I’ve searched around for this, but I can’t work out how to accomplish it, or even quite what to search for.

I’m generating notifications on my server. So, to take a simple example, if you “follow” someone on our site, then you’ll get a notification like this:

```
Johnny is now following you.

```

I’d like to be able to generate a link to allow the followed person to click through to Johnny’s profile. Now, I can obviously easily generate a link:

```
<a href='/people/johnny'>Johnny</a>

```

But that isn’t bound to a route transition. So, how might I go about binding this on the client?

If I try something like saving the route name and params in the notification, and do this:

```
[{link-to notification.text notification.route notification.params}}

```

Where notification.route is “person” and params is “johnny”, it doesn’t link correctly. I’ve previously been able to bind routes in link-to to bound data (in the controller) but not here.

I’d like, if possible to transform the into a link-to. Is that feasible or possible? Prior art?

 

Thanks, Johnny

---

<div class="post-metadata">

**Author:** ![recipher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/recipher/32/9205_2.png) [@recipher](https://discuss.emberjs.com/u/recipher)\
**Post date:** [June 28, 2014, 12:20am UTC](https://discuss.emberjs.com/t/bind-to-a-server-generated-link/5789/2 "2014-06-28T00:20:16Z")

</div>

I’ve ended up using an action, and have it working. However, I’m still interested to know if it’s possible to convert an tag into a link-to?

 

I’m using location: auto. If it was a hash, it’d work, but I get a full page request it’s not.

---

<div class="post-metadata">

**Author:** ![rogeruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rogeruiz/32/9838_2.png) [@rogeruiz](https://discuss.emberjs.com/u/rogeruiz)\
**Post date:** [June 28, 2014, 2:58am UTC](https://discuss.emberjs.com/t/bind-to-a-server-generated-link/5789/3 "2014-06-28T02:58:41Z")

</div>

I would definitely try to keep everything on the Ember side of life. But if you really need links generated on your server, you could compile your Handlebars templates for a component on the server and generate it at a particular path in your components directory with the appropriate `{{server-side-link 'text' route param1 param2}}` string inside.

This is just a thought though. I would still keep your behaviors on the client-side, and just populate Models with the appropriate data needed to generate your links.
