# HTMLBars custom helper

**URL:** <https://discuss.emberjs.com/t/htmlbars-custom-helper/7437>\
**Category:** Uncategorized\
**Created:** [March 4, 2015, 12:05am UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437 "2015-03-04T00:05:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephencattaneo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/stephencattaneo/32/10416_2.png) [@stephencattaneo](https://discuss.emberjs.com/u/stephencattaneo)\
**Post date:** [March 4, 2015, 12:05am UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437/1 "2015-03-04T00:05:02Z")

</div>

Hi!

For me, yesterday was day one of using Ember seriously (in the past i’ve built a couple very trivial _hello world_ apps).

I’m trying to create a custom template helper. Any idea why the linked code isn’t working as I’d expect? I’m trying to send the model (which contains an array) to a helper that should join the array elements together as a string, but instead I get the literal string “model”.

> **[JS Bin](http://jsbin.com/pizane/2/edit?html,js,output)**
>
> A live pastebin for HTML, CSS & JavaScript and a range of processors, including SCSS, CoffeeScript, Jade and more...

Looking over the sample templates on the handlebars site, this should work. (I know that handlebars != htmlbars, but I had thought that htmlbars was able to grok a handlebars template.)

---

<div class="post-metadata">

**Author:** ![atsjj](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/atsjj/32/14817_2.png) [@atsjj](https://discuss.emberjs.com/u/atsjj)\
**Post date:** [March 4, 2015, 6:43am UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437/2 "2015-03-04T06:43:41Z")

</div>

I think I got it fixed for you.

Here, try this out: [JS Bin - Collaborative JavaScript Debugging](http://jsbin.com/pepela/1/edit?html,js,output)

---

<div class="post-metadata">

**Author:** ![stephencattaneo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/stephencattaneo/32/10416_2.png) [@stephencattaneo](https://discuss.emberjs.com/u/stephencattaneo)\
**Post date:** [March 4, 2015, 5:27pm UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437/3 "2015-03-04T17:27:16Z")

</div>

Awesome!

I guess I needed `Ember.Handlebars.registerBoundHelper` instead of `Ember.Handlebars.registerHelper`

Whats the purpose of `Ember.Handlebars.registerHelper` (I’m not certain what lead me to believe I wanted registerHelper). Looking at the API ([Ember - 4.6 - Ember API Documentation](http://emberjs.com/api/classes/Ember.Handlebars.html)) I don’t see registerHelper listed. That said there are handful of links in the API that have ‘handlebars’ and ‘htmlbars’ as part of their title and its not clear to me which one(s) I should care about.

All the same. Thanks for getting me unstuck!!

---

<div class="post-metadata">

**Author:** ![stephencattaneo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/stephencattaneo/32/10416_2.png) [@stephencattaneo](https://discuss.emberjs.com/u/stephencattaneo)\
**Post date:** [March 4, 2015, 5:29pm UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437/4 "2015-03-04T17:29:29Z")

</div>

Ok I know where I got registerHelper from. [This issue](https://github.com/wycats/handlebars.js/issues/133) about creating a custom ‘join’ helper. Clearly it was written pre-htmlbar days.

---

<div class="post-metadata">

**Author:** ![atsjj](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/atsjj/32/14817_2.png) [@atsjj](https://discuss.emberjs.com/u/atsjj)\
**Post date:** [March 4, 2015, 5:38pm UTC](https://discuss.emberjs.com/t/htmlbars-custom-helper/7437/5 "2015-03-04T17:38:45Z")

</div>

`Handlebars.registerHelper` is a legit method, but it belongs to `Handlebars` proper. Also, there’s some utility behind `registerBoundHelper` inside Ember that wires up binding, where the plain `registerHelper` in the Handlebars library wouldn’t.

Hope that makes some sense.
