Custom Handlebars block helper
ember.js, handlebars.js
Solution
6 months later, it looks like this is possible now, at least to a certain extent. You can view the discussion here. I agree with the pull request that this should usually be handled using computed properties, but this is still very useful in some cases.
I'm going to accept this answer to keep this post updated. If I've broken any SO etiquette, let me know. :)
Problem
How do I define a custom block helper in Handlebars (for use with Ember.js)? I've tried using the method described on the Handlebars site, but it doesn't seem to work. I get this error from Ember.js: ``` Assertion failed: registerBoundHelper-generated helpers do not support use with Handlebars blocks. ``` Here's the code for my helper. The idea is that the block will only be rendered if the models that I pass in are the same: ``` Ember.Handlebars.helper 'sameModel', (model1, model2, options) -> if model1 is model2 new Handlebars.SafeString(options.fn(this)) else '' ```